473,326 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Calling .Net web service from my JSP page

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.
Expand|Select|Wrap|Line Numbers
  1. <%@ page contentType="text/html;charset=windows-1252"%>
  2. <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  3. <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  4. <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  5.  
  6.  
  7. <html:html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  10.  
  11. <TITLE>ExpressPlus</TITLE>
  12. </head>
  13.  
  14. <%
  15. String userid = request.getParameter("userid");
  16. String firstname = request.getParameter("firstname");
  17. String lastname = request.getParameter("lastname");
  18.  
  19. %>
  20.  
  21. <script language="JavaScript">
  22. <!--
  23. var iCallID = 0;
  24. var userid = "<%=userid%>";
  25. var firstname="";
  26. var lastname="";
  27.  
  28. function loadService() {
  29.  
  30.  explusService.useService("http://www.mytest.com/Login_service.asmx?wsdl","pushData");
  31.  iCallID = explusService.pushData.callService(explusResults,"Push_Data",userid,firstname,lastname);
  32.  
  33.   }
  34.  
  35.  
  36. function explusResults(result) {
  37.  
  38.    if (iCallID == result.id)
  39.    {
  40.       if (result.error)
  41.       {
  42.         var xfaultcode = result.errorDetail.code;
  43.         var xfaultstring = result.errorDetail.string;
  44.         var xfaultsoap = result.errorDetail.raw;
  45.           alert ("fault: " + xfaultcode + ": " + xfaultstring + ": "+ xfaultsoap) 
  46.       }
  47.       else {
  48.         alert("result: " + result.value);
  49.              }   }
  50. }
  51.  
  52. //-->
  53.  
  54. </script>
  55. <body onload="loadService()" >
  56.  
  57. <div ID="explusService" style="behavior:url(<%=request.getContextPath()%>/explus/webservice.htc)">
  58.  
  59. </div>
  60. </body>
  61. </html:html>
Please help. It is kind of urgent.

Thank you very much in advance.
Jul 10 '07 #1
4 4090
Motoma
3,237 Expert 2GB
Since the code works properly on your development machine, I am going to rule out a coding error. This leaves open two options in my mind, configuration and networking.
What is the physical topology of your network? I'm looking for information about the dev box, the test box, and the webservice box.
Are there any differences between your development machine and your test machine? Are the application servers configured identically?
Is there a firewall in place? Are the computers (test and webservice) on the same subnet?
Jul 11 '07 #2
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 ISS 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 #3
Motoma
3,237 Expert 2GB
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 ISS 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.
You shouldn't need an application proxy. Talk to your network guys and explain the problem. They will likley have a different, easier solution for you.
Jul 11 '07 #4
Hi,

My web service is on one server and jsp page is on other server. So i cant access web service using webservice.htc file.Also i need it to call in mozilla. So i dont know about proxy cration and how to call from proxy.So can anybody tell steps how to call web service in javascript(jsp) using roxy


Thanks,

Mahendra
Oct 9 '09 #5

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

Similar topics

17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
0
by: Michael Brandt Lassen | last post by:
Hi gurus This problem is about calling Web services secured by Forms Authentication from Windows Forms user controls embedded in HTML. Using the object tag I’ve managed to include a Windows...
5
by: niftyhawk | last post by:
Hi, Can anybody give me a simple example of how to Call Web Services from Mozilla based Browsers ? I can call web services from IE browser using web service behavior file, without any problems....
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. ...
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...
1
by: Sudha | last post by:
Hi All, I've a requirement to call a web service from an ASP page. As we have only two options, using SOAP Toolkit 3.0 and XMLHttp object, which are not upto my requirement, I thought I will...
4
by: gengyue | last post by:
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...
2
by: brian.ackermann | last post by:
Hello All, I have a project where I am being asked to expose some functionality to a customer via a web-service-like interface. This service will be written in Classic ASP, and will take a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.