473,549 Members | 2,750 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling .Net web service from JSP

10 New Member
Hi,

I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to call .Net web service method. I am using Oracle 10g Jdeveloper. The whole works smoothly on my local computer. However, when I deploy them on our test server. I always get "service unavailabe" error. We are on Unix system, J2ee enviroment, with Oracle application server as web server.

Here is part of my JSP page. By the way, webservice.htc is in the same directory as this JSP.

<%@ page contentType="te xt/html;charset=wi ndows-1252"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


<html:html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<TITLE>ExpressP lus</TITLE>
</head>

<%
String userid = request.getPara meter("userid") ;
String firstname = request.getPara meter("firstnam e");
String lastname = request.getPara meter("lastname ");

%>

<script language="JavaS cript">
<!--
var iCallID = 0;
var userid = "<%=userid% >";
var firstname="";
var lastname="";

function loadService() {

explusService.u seService("http ://www.mytest.com/Login_service.a smx?wsdl","push Data");
iCallID = explusService.p ushData.callSer vice(explusResu lts,"Push_Data" ,userid,firstna me,lastname);

}


function explusResults(r esult) {

if (iCallID == result.id)
{
if (result.error)
{
var xfaultcode = result.errorDet ail.code;
var xfaultstring = result.errorDet ail.string;
var xfaultsoap = result.errorDet ail.raw;
alert ("fault: " + xfaultcode + ": " + xfaultstring + ": "+ xfaultsoap)
}
else {
alert("result: " + result.value);
} }
}

//-->

</script>
<body onload="loadSer vice()" >

<div ID="explusServi ce" style="behavior :url(<%=request .getContextPath ()%>/explus/webservice.htc) ">

</div>
</body>
</html:html>

Please help. It is kind of urgent.

Thank you very much in advance.
Jul 10 '07 #1
4 3861
r035198x
13,262 MVP
Can you explain how you're deploying it and at stage you're getting the error?
Jul 10 '07 #2
gengyue
10 New Member
Hi,

I am just adding this new feature to an existing struts application, so I just copy all related files, including JSP, action form class, action class and modified struts-config.xml to different directories ( I can access test server from my local machine) . Finally, I restarted the server.

The validation part is successful, which means struts part is no problem. In action class, it forwards page to the JSP, which calls web service. Then the screen brings up alert message box and tells me service unavaliable. the value is null.

Thank you.
Jul 10 '07 #3
r035198x
13,262 MVP
Hi,

I am just adding this new feature to an existing struts application, so I just copy all related files, including JSP, action form class, action class and modified struts-config.xml to different directories ( I can access test server from my local machine) . Finally, I restarted the server.

The validation part is successful, which means struts part is no problem. In action class, it forwards page to the JSP, which calls web service. Then the screen brings up alert message box and tells me service unavaliable. the value is null.

Thank you.
I know you'll think I'm an idiot but have you made sure that the .NET webservice is running?
Jul 11 '07 #4
gengyue
10 New Member
Hi,

Thanks for your reply.

After intensive internet searching, I think I know the problem. We are facing cross domain issue when using Web service behavior, because .Net webservice is hosted on IIS server. My web page is on oracle application server. We have different domain. I need to create proxy web service to make these two servers talk.

Do you have any sample code for this?

Thank you very much.
Jul 11 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2414
by: jarmopy | last post by:
Hi, I have made a service with C# and calling that service class from another C# program with remoting. (Referendes from the calling program) That service class is configured so that garpage collection is not used in this class. (singleton class + override InitializeLifetimeService ) The service class uses C++ unmanaged function from...
0
2234
by: Cleo | last post by:
Hi, I am trying to call a WebService Method written in Weblogic from VB.NET and I am getting the following error. I am using SOAP Caal s from VB.NET. Please find the wsdl file and my code. Any help would really be appreciated. Thx
3
9064
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. If the web service is taking a long time to complete, the aspx page returns a ‘The operation has timed-out.’ Message to the web browser after...
3
5049
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb). I changed the data type for the structure that contains the XML data from the default "String" to "xml.xmldocument" to enable easy filling of the...
7
6006
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is or do i need to write the xml as text from the web service and supply a DTD. Also any other pitfalls TIA
5
2585
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is fine so far. My problem is that when I call a web method to modify the dataset inside the Web service it is never updated and I get no errors. ...
1
1559
by: fallenidol | last post by:
hi i'm looking for some heads up info regarding calling and using a web service from within another web service. is this acceptable practice? if not why? what should i be thinking about here? cheers
2
2840
by: Johan | last post by:
We have run into problems calling a web service from a client running .NET framework 2.0. The problem is that the first call to the web service, after the client has been started, takes very long time, something like 15 to 30 seconds. All subsequent calls are really fast (about 10 milliseconds). But when the client is restarted, the first call...
1
2979
by: ananth | last post by:
Hi All, I have a web service created in Notes Database and i am calling the web service in Visual studio.Net application by adding a web reference. I need to have authentication mechanism before calling the methods within the web service.I used the NetworkCredentials Property for authenticating but the user name and password is not...
7
2667
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file name based on the name of the VB6 application. A second choice would be a file name based on the # COM interface assembly. I have tried calling...
0
7477
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7991
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5396
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3524
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1971
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1084
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.