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>