C# calling JAVA web service - results are null

G

Guest

I have a simple c# app that calls a Java (AXIS) web service to perform some
operations. The call works fine (the java code fires and the operations are
executed), but the response is always null. Other applications (besides the
c# ones) are able to execute the web service and get the proper response.

I put a SOAP sniffer on the call and the response was:
193
<?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><synchronousInvokeResponse
xmlns="http://DefaultNamespace"><processID xsi:type="xsd:long"
xmlns="">205</processID></synchronousInvokeResponse></soapenv:Body></soapenv:Envelope>
0

</Message>

I'm not sure where the 193, 0 and </Message> came from but I suspect that it
was caused by some chunking issues.

The response header is as follows:
<HTTPHeaders>
<content-type>text/xml;charset=utf-8</content-type>
<transfer-encoding>chunked</transfer-encoding>
<date>Wed, 26 Apr 2006 19:07:26 GMT</date>
<server>Apache-Coyote/1.1</server>
</HTTPHeaders>


Any thoughts on how I can get the c# application to properly recognize the
response? Unfortunately I can't change the Java web service.


The Java web service WSDL is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://adobe.com/workflow/services"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://adobe.com/workflow/services"
xmlns:intf="http://adobe.com/workflow/services"
xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd"
xmlns:tns1="http://DefaultNamespace"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--
Generated by Adobe Workflow Server v7.0

getAccountData

-->
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://DefaultNamespace"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="invoke">
<complexType>
<sequence>
<element name="accountnumber" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="invokeResponse">
<complexType>
<sequence>
<element name="processID" type="xsd:long"/>
</sequence>
</complexType>
</element>
<element name="synchronousInvoke">
<complexType>
<sequence>
<element name="accountnumber" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="synchronousInvokeResponse">
<complexType>
<sequence>
<element name="processID" type="xsd:long"/>
</sequence>
</complexType>
</element>
<element name="getResults">
<complexType>
<sequence>
<element name="processID" type="xsd:long"/>
</sequence>
</complexType>
</element>
<element name="getResultsResponse">
<complexType>
<sequence>
<element name="processID" type="xsd:long"/>
</sequence>
</complexType>
</element>
<element name="getStatus">
<complexType>
<sequence>
<element name="processID" type="xsd:long"/>
</sequence>
</complexType>
</element>
<element name="getStatusResponse">
<complexType>
<sequence>
<element name="processID" type="xsd:long"/>
<element name="statusString" type="xsd:string"/>
<element name="statusCode" type="xsd:int"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getStatusResponse">
<wsdl:part element="tns1:getStatusResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getResultsRequest">
<wsdl:part element="tns1:getResults" name="parameters"/>
</wsdl:message>
<wsdl:message name="synchronousInvokeResponse">
<wsdl:part element="tns1:synchronousInvokeResponse"
name="parameters"/>
</wsdl:message>
<wsdl:message name="getResultsResponse">
<wsdl:part element="tns1:getResultsResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getStatusRequest">
<wsdl:part element="tns1:getStatus" name="parameters"/>
</wsdl:message>
<wsdl:message name="invokeResponse">
<wsdl:part element="tns1:invokeResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="synchronousInvokeRequest">
<wsdl:part element="tns1:synchronousInvoke" name="parameters"/>
</wsdl:message>
<wsdl:message name="invokeRequest">
<wsdl:part element="tns1:invoke" name="parameters"/>
</wsdl:message>
<wsdl:portType name="getXMLData">
<wsdl:blush:peration name="invoke">
<wsdl:input message="impl:invokeRequest" name="invokeRequest"/>
<wsdl:blush:utput message="impl:invokeResponse"
name="invokeResponse"/>
</wsdl:blush:peration>
<wsdl:blush:peration name="synchronousInvoke">
<wsdl:input message="impl:synchronousInvokeRequest"
name="synchronousInvokeRequest"/>
<wsdl:blush:utput message="impl:synchronousInvokeResponse"
name="synchronousInvokeResponse"/>
</wsdl:blush:peration>
<wsdl:blush:peration name="getResults">
<wsdl:input message="impl:getResultsRequest"
name="getResultsRequest"/>
<wsdl:blush:utput message="impl:getResultsResponse"
name="getResultsResponse"/>
</wsdl:blush:peration>
<wsdl:blush:peration name="getStatus">
<wsdl:input message="impl:getStatusRequest"
name="getStatusRequest"/>
<wsdl:blush:utput message="impl:getStatusResponse"
name="getStatusResponse"/>
</wsdl:blush:peration>
</wsdl:portType>
<wsdl:binding name="getXMLDataSoapBinding" type="impl:getXMLData">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:blush:peration name="invoke">
<wsdlsoap:blush:peration soapAction=""/>
<wsdl:input name="invokeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:blush:utput name="invokeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:blush:utput>
</wsdl:blush:peration>
<wsdl:blush:peration name="synchronousInvoke">
<wsdlsoap:blush:peration soapAction=""/>
<wsdl:input name="synchronousInvokeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:blush:utput name="synchronousInvokeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:blush:utput>
</wsdl:blush:peration>
<wsdl:blush:peration name="getResults">
<wsdlsoap:blush:peration soapAction=""/>
<wsdl:input name="getResultsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:blush:utput name="getResultsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:blush:utput>
</wsdl:blush:peration>
<wsdl:blush:peration name="getStatus">
<wsdlsoap:blush:peration soapAction=""/>
<wsdl:input name="getStatusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:blush:utput name="getStatusResponse">
<wsdlsoap:body use="literal"/>
</wsdl:blush:utput>
</wsdl:blush:peration>
</wsdl:binding>
<wsdl:service name="getXMLDataService">
<wsdl:port binding="impl:getXMLDataSoapBinding" name="getXMLData">
<wsdlsoap:address
location="http://localhost:8080/services/getXMLData"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
 
A

Alvin Bruney

that's really wiered. what does the java web service send back? Is it a
custom type or something else? If it is a custom type, you may want to have
your code create an object of the custom type. I can't really say that an
exception is thrown because the exception would be wrapped in a
soapexception object and your code would fall over dead on your side. you
say that if you call the same service from a none c# app, you get back the
correct results? the mystery deepens...

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------
 
G

Guest

The java web service retruns a xsd:long object, so I wouldn't think that it
would be a problem
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top