473,395 Members | 1,581 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,395 software developers and data experts.

How to call Java Web Service through .net

I had deploy a program to call Java Web services from VB.net . Below is my code:

Expand|Select|Wrap|Line Numbers
  1.        Dim myGetCustInfoNewService As GetCustInfoNewService.SA1Z1003 = New GetCustInfoNewService.SA1Z1003()
  2.  
  3.  
  4.             Dim a As Integer = myCalculatorService.Add(6, 2)
  5.  
  6.             '---------------------Define Input Parameter----------------------------
  7.             strTransNo = Date.Today.Year.ToString.PadLeft(4, CChar("0")) & _
  8.                             Date.Now.Month.ToString.PadLeft(2, CChar("0")) & _
  9.                             Date.Now.Day.ToString.PadLeft(2, CChar("0")) & _
  10.                             Date.Now.Hour.ToString.PadLeft(2, CChar("0")) & _
  11.                             Date.Now.Minute.ToString.PadLeft(2, CChar("0")) & _
  12.                             Date.Now.Second.ToString.PadLeft(5, CChar("0")) & _
  13.                             Date.Now.Millisecond.ToString.PadLeft(6, CChar("0"))
  14.  
  15.  
  16.  
  17.             Dim myInstanceGetCustInfoNewServiceRequest As GetCustInfoNewService.SA1Z1004 = New GetCustInfoNewService.SA1Z1004()
  18.             myInstanceGetCustInfoNewServiceRequest.TransNo = strTransNo
  19.             myInstanceGetCustInfoNewServiceRequest.TypOpt = strTypOpt
  20.             myInstanceGetCustInfoNewServiceRequest.OptInp = strOptInp
  21.  
  22.             'Dim strAbc As String()
  23.             'strAbc = myGetCustInfoNewService.SA1Z1004(myInstanceGetCustInfoNewServiceRequest)
  24.  
  25.  
  26.  
  27.             Dim myKey
  28.             myKey = " <SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/""" & _
  29.                     " xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/""" & _
  30.                    " xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""" & _
  31.                     " xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> " & _
  32.                     " <SOAP-ENV:Body> " & _
  33.                     " <SA1Z1003 xmlns=""http://TestWeb/cics/esp1/dfhwsdsh/espick""> " & _
  34.                         " <SA1Z1003>" & _
  35.                             "<TransNo>" & strTransNo & "</TransNo> " & _
  36.                             "<TypOpt>" & strTypOpt & "</TypOpt> " & _
  37.                            "<OptInp>" & strPVaccNo & "</OptInp> " & _
  38.                         " <SA1Z1003>" & _
  39.                     "</SA1Z1003> " & _
  40.                     "</SOAP-ENV:Body> " & _
  41.                     "</SOAP-ENV:Envelope> "
  42.  
  43.  
  44.             Dim soap As Object
  45.             soap = Server.CreateObject("MSXML2.ServerXMLHTTP")
  46.             soap.open("post", "http://TestWeb/cics/esp1/dfhwsdsh/esp", False)
  47.             soap.setRequestHeader("Content-Type", "text/xml")
  48.             soap.setRequestHeader("soapAction", "http://TestWeb/cics/esp1/dfhwsdsh/esp/SA1Z1004")
  49.             soap.send(myKey)
  50.  
  51.             If soap.status = 200 Then
  52.                 Dim Res1 As Object
  53.                 Res1 = Server.CreateObject("MSXML2.DOMDocument")
  54.                 Res1.loadXML(soap.responseText)
  55.                 Res1.save("c:\sucess.xml")
  56.  
  57.             Else
  58.                 Dim Res2 As Object
  59.                 Res2 = Server.CreateObject("MSXML2.DOMDocument")
  60.                 Res2.loadXML(soap.responseText)
  61.                 Res2.save("c:\error.xml")
  62.             End If

after run the code, I had get soap error code 500 after soap.send(), is that anything wrong with my program ??
May 2 '10 #1
2 2878
tlhintoq
3,525 Expert 2GB
TIP: When you first created your question you were asked to wrap your code with [code] tags.

It really does help a bunch. Look how much easier it is to read now that someone has done it for you. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
May 2 '10 #2
Frinavale
9,735 Expert Mod 8TB
500 Error means that the server encountered an unexpected condition which prevented it from fulfilling the request.

Check the server for the reason...
May 4 '10 #3

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

Similar topics

6
by: Dave Kuhlman | last post by:
Is JPE (the Python Java Extension) being used widely/actively? I tried to build it (with Python 2.3.4, j2se 1.4 on Debian GNU/Linux) and had quite a bit of trouble. And, then, the samples did...
0
by: tony | last post by:
Hi Is it possible to write a C client that can commununicate via soap to a java based service using method calls? I want the C client to be able to call methods on the java service, and each of...
4
by: Alan Wang | last post by:
Hi there: I am just wondering if I could call java library using C#. The reason to do that is my application wants to automate OpenOffice and create document. Thanks in advance Alan
0
by: kiran | last post by:
how to call java web service which has webmethod say Function1 syntax of Function1 object Function1(object obj) am trying to call web service from .net client when i call this web method with...
0
by: pumaken68 | last post by:
Does anyone has experience with calling web service from pocket pc 2003 project in VS 2005 environment? I just migrated a smart device(pocket pc 2003) solution from VS 2003 to VS 2005. There are...
11
by: BigZero | last post by:
Hello, can i call Java method.That is java code from php,here what i m looking for i have class called DB in this class all the DB related things ,like DB connection DB insert,DB read etc...
1
by: Ahmad Jalil Qarshi | last post by:
Hi, I am develop a dynamic link library in C on AIX that will internally call java functions using JNI. This libaray will be finally used by other C Executable. There is only one function in...
1
by: eternalLearner | last post by:
hi , I need help on how is it possible to implement communication between a flex frontend and a java service. The queries that are executed are both push as well as pull type.
0
by: adrya1984 | last post by:
Hi, I have a Java service that has the following method signature: @WebMethod(operationName = "getContactList") public MyListClass getContactList(@WebParam(name = "myList")...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...

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.