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

Web service client proxy returns null instead of response

Slightly different situation from the question of the 11/18/05 but the same
error.
(I'm just learning about web services so this is based on a 'quick tutorial')

I'm running a web service using Axis and want to consume it with a .NET
client.
So I've created the web proxy using wsdl.exe and I can call the service and
it responds but the client returns null.
If I run a Java client then it gets the response fine and dandy.
The web service is supposed to be set to use Document encoding not RPC as
this is the way we want to go.
Can anyone tell me how I can get information from the .NET framwork to
figure out whats happening in the SoapHttpClientProtocol.EndInvoke method
which is where I think the results are not being coerced into the required
objects.

This is the WSDL I used:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="http://schemas/services/stockquote/wsdl"
xmlns:sqt="http://schemas/services/stockquote"
xmlns:tns="http://schemas/services/stockquote/wsdl" >

<types>
<xsd:schema targetNamespace="http://schemas/services/stockquote"
elementFormDefault="qualified">
<xsd:include schemaLocation=".\StockQuote.xsd" />
</xsd:schema>
</types>

<message name="getStockQuoteInput">
<part name="symbol" element="sqt:getStockQuote" />
</message>
<message name="getStockQuoteOutput">
<part name="result" element="sqt:getStockQuoteResult" />
</message>

<portType name="StockQuotePortType">
<operation name="getStockQuote">
<input message="tns:getStockQuoteInput" />
<output message="tns:getStockQuoteOutput" />
</operation>
</portType>

<binding name="StockQuoteBinding" type="tns:StockQuotePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getStockQuote">
<soap:operation style="document" soapAction="getStockQuote" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="StockQuoteService">
<port name="StockQuote" binding="tns:StockQuoteBinding">
<soap:address
location="http://localhost:8080/axis/services/StockQuote" />
</port>
</service>
</definitions>

And this is the XML schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://schemas/services/stockquote"
xmlns="http://schemas/services/stockquote"


<!-- ********************** Types ********************** -->

<xs:complexType name="changeType">
<xs:sequence>
<xs:element name="dollar" type="xs:float"/>
<xs:element name="percent" type="xs:float"/>
<xs:element name="positive" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="lastTradeType">
<xs:sequence>
<xs:element name="price" type="xs:float"/>
<xs:element name="date" type="xs:long"/>
</xs:sequence>
</xs:complexType>

<xs:element name="oQuote">
<xs:complexType>
<xs:sequence>
<xs:element name="symbol" type="xs:string"/>
<xs:element name="volume" type="xs:integer"/>
<xs:element name="lastTrade" type="lastTradeType"/>
<xs:element name="change" type="changeType"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<!-- ********************** Methods ********************** -->

<xs:element name="getStockQuote">
<xs:complexType>
<xs:sequence>
<xs:element name="symbol" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="getStockQuoteResult">
<xs:complexType>
<xs:sequence>
<xs:element ref="oQuote" />
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>

And this is SOAP response mssage:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<soapenv:Body>
<getStockQuoteResponse xmlns="http://schemas/services/stockquote">
<oQuote>
<symbol>ibm</symbol>
<volume>20000</volume>
<lastTrade>
<price>5.5</price>
<date>1132749558786</date>
</lastTrade>
<change>
<dollar>4.5</dollar>
<percent>3.4</percent>
<positive>true</positive>
</change>
</oQuote>
</getStockQuoteResponse>
</soapenv:Body>
</soapenv:Envelope>

Nov 23 '05 #1
1 3629
I've now made progress past this, Hurrah!

Unlike what I thought the web service I was running was still using RPC
encoding.
I would love to tell you exactly what I did to remedy this but I tinkered
with so many different things I'm not sure which one fixed it.
However I did find that I needed to be carefull in the naming of the
elements in the XML schema so that they did not clash with the actual service
name.
And I used the following syntax to include the schema and then re-created
both the service and client again from the new wsdl.
<types>
<xsd:schema targetNamespace="http://schemas/services/stockquote"
elementFormDefault="qualified">
<xsd:include schemaLocation=".\StockQuote.xsd" />
</xsd:schema>
</types>

Hope this helps

Nov 28 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: JLJ | last post by:
I have a very simple webservice written in Java/Axis. It takes in a complexType with 2 string elements, userid and password. The response is a complexType containing two complexTypes each having...
2
by: Paul Hale | last post by:
I have a vb.net web service and client that are both working fine. If someone wanted to consume our web service using .NET, no problem. Im a little confused on how non .NET clients would use the...
5
by: Gardar | last post by:
I have a .net webservice, developed with c++ managed extensions. The websrvice returns an xml-document with a reference to a server side xml-stylesheet in the format <?xml-stylesheet href =...
1
by: Parag Mahajan | last post by:
Hi, I am developing a .Net client for Axis 1.1 web service written in java. The wsdl is generated using, java2WSDL with these switches:: -y WRAPPED -u LITERAL The login service which returns a...
0
by: Jamie Phillips | last post by:
I'm sure this topic has been "around the block" a few times, but I have not been able to find ANY solutin that fits this particular problem. I have written a Java Axis web service that has a method...
7
by: Jamie Phillips | last post by:
I'm sure this topic has been "around the block" a few times, but I have not been able to find ANY solutin that fits this particular problem. I have written a Java Axis web service that has a method...
9
by: jsoques | last post by:
Hello, I created a Web Service using .Net 2.0 that has a function that returns a DataTable. I can test the function from the web page when I access the .asmx from a browser on localhost and it...
1
by: Gramps | last post by:
Hi, I've generated a client proxy and web service stub using WSDL.exe. All appears ok. The client proxy .cs is in the client app running in VS2005 and the web service stub is running in...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
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.