By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,636 Members | 1,941 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,636 IT Pros & Developers. It's quick & easy.

Web service client proxy returns null instead of response

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.