473,761 Members | 5,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling .Net web service from my JSP page

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.
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 4121
Motoma
3,237 Recognized Expert Specialist
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 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 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 Recognized Expert Specialist
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
mahendragurav
1 New Member
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
14793
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 web-service in a an asynchronous mode (with a callback function)? If so, how?
0
1664
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 Forms user control in my HTML page (a .NET alternative to good old ActiveX). I’d like to use my control to call web-services instead of using behaviours (webservices.htc).
5
6775
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. Just wanted to know an easy way to call them from Firefox or Netscape. Thanks, Nifty.
0
2246
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
9103
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 100 seconds. I’ve added: <httpRuntime executionTimeout="300" /> to the web.config files
7
6019
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
1
2466
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 create a compenent using c# which calls the web service and I thought I can call that component very easily from ASP. But I'm getting access denied errror while calling the .net dll/component from my asp page. I need to let the IWAM_<machinename>...
4
3872
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 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...
2
1861
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 number of parameters, process some logic,and then return some information to the consumer. I've now built a number of these services (Following something of a RESTful approach), and the next one I need to build happens to require some information...
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9336
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
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
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.