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

Calling an Axis-1.4 Web Service from VB.Net

I've got some VB code that's supposed to retrieve a Map from a Web Service written in Java, running under Tomcat via Axis-1.4. I'll list the WSDL, the response message and the source code below.

My problem is that while the response contains actual data, the call to Invoke() returns Nothing. I'm hoping someone can tell me why.

Thanks in advance.

WSDL (i hope stripped down to about the bare minimum):

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <wsdl:definitions targetNamespace="urn:my-vmapi" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:my-vmapi" xmlns:intf="urn:my-vmapi" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  3.     <!--WSDL created by Apache Axis version: 1.4
  4. Built on Apr 22, 2006 (06:55:48 PDT)-->
  5.     <wsdl:types>
  6.         <schema targetNamespace="urn:my-vmapi" xmlns="http://www.w3.org/2001/XMLSchema">
  7.             <import namespace="http://xml.apache.org/xml-soap"/>
  8.             <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
  9.             <complexType name="ArrayOf_soapenc_string">
  10.                 <complexContent>
  11.                     <restriction base="soapenc:Array">
  12.                         <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
  13.                     </restriction>
  14.                 </complexContent>
  15.             </complexType>
  16.         </schema>
  17.         <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
  18.             <import namespace="urn:my-vmapi"/>
  19.             <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
  20.             <complexType name="mapItem">
  21.                 <sequence>
  22.                     <element name="key" nillable="true" type="xsd:anyType"/>
  23.                     <element name="value" nillable="true" type="xsd:anyType"/>
  24.                 </sequence>
  25.             </complexType>
  26.             <complexType name="Map">
  27.                 <sequence>
  28.                     <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:mapItem"/>
  29.                 </sequence>
  30.             </complexType>
  31.         </schema>
  32.     </wsdl:types>
  33.     <wsdl:message name="getRequest">
  34.         <wsdl:part name="username" type="soapenc:string"/>
  35.         <wsdl:part name="admin" type="soapenc:string"/>
  36.         <wsdl:part name="password" type="soapenc:string"/>
  37.     </wsdl:message>
  38.     <wsdl:message name="getResponse">
  39.         <wsdl:part name="getReturn" type="apachesoap:Map"/>
  40.     </wsdl:message>
  41.     <wsdl:portType name="Provisioning">
  42.         <wsdl:operation name="get" parameterOrder="username admin password">
  43.             <wsdl:input message="impl:getRequest" name="getRequest"/>
  44.             <wsdl:output message="impl:getResponse" name="getResponse"/>
  45.         </wsdl:operation>
  46.     </wsdl:portType>
  47.     <wsdl:binding name="vmSoapBinding" type="impl:Provisioning">
  48.         <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  49.         <wsdl:operation name="get">
  50.             <wsdlsoap:operation soapAction=""/>
  51.             <wsdl:input name="getRequest">
  52.                 <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:my-vmapi" use="encoded"/>
  53.             </wsdl:input>
  54.             <wsdl:output name="getResponse">
  55.                 <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:my-vmapi" use="encoded"/>
  56.             </wsdl:output>
  57.         </wsdl:operation>
  58.     </wsdl:binding>
  59.     <wsdl:service name="ProvisioningService">
  60.         <wsdl:port binding="impl:vmSoapBinding" name="vm">
  61.             <wsdlsoap:address location="http://myapi.com/axis/services/vm"/>
  62.         </wsdl:port>
  63.     </wsdl:service>
  64. </wsdl:definitions>
The Response:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  3.   <soapenv:Body>
  4.     <ns1:getResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:my-vmapi">
  5.       <getReturn href="#id0"/>
  6.     </ns1:getResponse>
  7.     <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Map" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://xml.apache.org/xml-soap">
  8.       <item>
  9.         <key xsi:type="soapenc:string">ext</key>
  10.         <value xsi:type="soapenc:int">120</value>
  11.       </item>
  12.       <item>
  13.         <key xsi:type="soapenc:string">box_size</key>
  14.         <value xsi:type="soapenc:int">5</value>
  15.       </item>
  16.       <item>
  17.         <key xsi:type="soapenc:string">mb_username</key>
  18.         <value xsi:type="soapenc:string">john</value>
  19.       </item>
  20.       <item>
  21.         <key xsi:type="soapenc:string">language</key>
  22.         <value xsi:type="soapenc:string">en</value>
  23.       </item>
  24.       <item>
  25.         <key xsi:type="soapenc:string">firstname</key>
  26.         <value xsi:type="soapenc:string">John</value>
  27.       </item>
  28.       <item>
  29.         <key xsi:type="soapenc:string">lastname</key>
  30.         <value xsi:type="soapenc:string">Smith</value>
  31.       </item>
  32.       <item>
  33.         <key xsi:type="soapenc:string">attach</key>
  34.         <value xsi:type="soapenc:boolean">true</value>
  35.       </item>
  36.       <item>
  37.         <key xsi:type="soapenc:string">PIN</key>
  38.         <value xsi:type="soapenc:string">7777</value>
  39.       </item>
  40.       <item>
  41.         <key xsi:type="soapenc:string">email</key>
  42.         <value xsi:type="soapenc:string">js@qmail.org</value>
  43.       </item>
  44.       <item>
  45.         <key xsi:type="soapenc:string">password</key>
  46.         <value xsi:type="soapenc:string">pwd</value>
  47.       </item>
  48.     </multiRef>
  49.   </soapenv:Body>
  50. </soapenv:Envelope>
The Code:
Expand|Select|Wrap|Line Numbers
  1.         <System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace:="urn:my-vmapi", ResponseNamespace:="urn:my-vmapi")>  _
  2.         Public Function [get](ByVal username As String, ByVal admin As String, ByVal password As String) As <System.Xml.Serialization.SoapElementAttribute("getReturn")> Map
  3.             Dim results() As Object = Me.Invoke("get", New Object() {username, admin, password})
  4.             Return CType(results(0),Map)
  5.         End Function
May 21 '07 #1
5 4413
RedSon
5,000 Expert 4TB
Not sure how to help you on this one. But you can use java programs in .NET if you compile them with the Microsoft compiler. Microsoft uses J# which is an almost verbatim port of Sun's Java. If it works for you in Java but not in VB maybe you can stick with that?
May 21 '07 #2
I appreciate the response, but working in J# isn't going to be the solution, for at least a couple of reasons:
  1. The Web Service runs on Linux, under Tomcat; I don't suppose J# will do that.
  2. The Service seems to be running fine - it puts out what seems to be a correct SOAP message as a response; it's just that the client code doesn't understand it.
May 21 '07 #3
RedSon
5,000 Expert 4TB
I appreciate the response, but working in J# isn't going to be the solution, for at least a couple of reasons:
  1. The Web Service runs on Linux, under Tomcat; I don't suppose J# will do that.
  2. The Service seems to be running fine - it puts out what seems to be a correct SOAP message as a response; it's just that the client code doesn't understand it.
Has this been working in the past?
May 21 '07 #4
Has this been working in the past?
I've got Java and PHP clients that have no trouble, but this is the first time I've tried it with a .NET client.
May 24 '07 #5
Motoma
3,237 Expert 2GB
Have you tried generating code using the wsdl command line utility? Here are two links that describe the process:
http://www.scottnichol.com/vbnetclientapachesoap.htm
http://users.skynet.be/pascalbotte/rcx-ws-doc/vbnet.htm
May 24 '07 #6

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

Similar topics

3
by: Maarten van Reeuwijk | last post by:
Hello, I am using the Numeric package, and I need to strip edge cells off an array (dimension unknown) in an a-priori unknown direction. I implented this as follows: def el_remove_bcells(var,...
3
by: Jacky Zhu | last post by:
Hi all, I am having a problem trying to consume a webservice that is developed on ..Net. I can access it without any problem using a .net client, but when I use a java client (based on Axis...
3
by: Claus Haslauer | last post by:
Hi, I want to create a chart value (y-axis) vs. time (x-axis). In fact very similar to the xy(scatter) example in the graph10.chm help-file. I ran into problems, so I started a very basic *.mdb...
3
by: Lilly | last post by:
I was testing a very simple web services written in Axis (1.2RC2) with just a single method, returning a string "test". The method doesn't need any parameters. when I tested it using .Net client,...
0
by: PkRichard | last post by:
I want to change the x axis of my mschart. I can change the y axis with the following commando: With Chart1.Plot.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).ValueScale .Auto = False .Minimum =...
0
by: Mrozik | last post by:
I call ASP.NET WebService method from Java client (axis) - call contains file as attachment. This is my code: String filePath = "F:\\Download\\17MAR2005 Exception Handling Block.ppt"; // 1.6 MB...
4
by: nawrin22 | last post by:
hi.. I am a niwebie in 'AXIS' . but i had correctly installed it without any problem with the help of 'apache.axis.install.pdf' and also tested the examples under 'samples\userguide' directoy...
0
by: dadasurf80 | last post by:
Hello, I've a problem with Axis which gives me a "Session alreday invalidated" message after a time of inactivity. I use: - Tomcat : 4.1.29 - Axis : 1.3 - JVM : 1.4.2-b28 The complete...
50
by: Gosi | last post by:
It is quite easy to call J from Python http://groups.google.com/group/J-Programming/browse_thread/thread/5e84b75667f5f64e
0
by: Just_a_fan | last post by:
Some folks have searched, from time to time, for a dual axis MSChart with different scales on the two Y axes. The sample, extracted from running code I wrote, produces a graph with MSChart (VB9)...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.