472,373 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

calling .Net web service from JSP

10
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="text/html;charset=windows-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>ExpressPlus</TITLE>
</head>

<%
String userid = request.getParameter("userid");
String firstname = request.getParameter("firstname");
String lastname = request.getParameter("lastname");

%>

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

function loadService() {

explusService.useService("http://www.mytest.com/Login_service.asmx?wsdl","pushData");
iCallID = explusService.pushData.callService(explusResults," Push_Data",userid,firstname,lastname);

}


function explusResults(result) {

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

//-->

</script>
<body onload="loadService()" >

<div ID="explusService" 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 3781
r035198x
13,262 8TB
Can you explain how you're deploying it and at stage you're getting the error?
Jul 10 '07 #2
gengyue
10
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 8TB
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
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
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...
0
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. ...
3
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. ...
3
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)....
7
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...
5
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...
1
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? ...
2
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...
1
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...
7
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.