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

C# calling JAVA web service - results are null

P: n/a
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:operation name="invoke">
<wsdl:input message="impl:invokeRequest" name="invokeRequest"/>
<wsdl:output message="impl:invokeResponse"
name="invokeResponse"/>
</wsdl:operation>
<wsdl:operation name="synchronousInvoke">
<wsdl:input message="impl:synchronousInvokeRequest"
name="synchronousInvokeRequest"/>
<wsdl:output message="impl:synchronousInvokeResponse"
name="synchronousInvokeResponse"/>
</wsdl:operation>
<wsdl:operation name="getResults">
<wsdl:input message="impl:getResultsRequest"
name="getResultsRequest"/>
<wsdl:output message="impl:getResultsResponse"
name="getResultsResponse"/>
</wsdl:operation>
<wsdl:operation name="getStatus">
<wsdl:input message="impl:getStatusRequest"
name="getStatusRequest"/>
<wsdl:output message="impl:getStatusResponse"
name="getStatusResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="getXMLDataSoapBinding" type="impl:getXMLData">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="invoke">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="invokeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="invokeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="synchronousInvoke">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="synchronousInvokeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="synchronousInvokeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getResults">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getResultsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getResultsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getStatus">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getStatusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getStatusResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</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>
Apr 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
-------------------------------------------------------

"BluNuit" <Bl*****@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
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:operation name="invoke">
<wsdl:input message="impl:invokeRequest"
name="invokeRequest"/>
<wsdl:output message="impl:invokeResponse"
name="invokeResponse"/>
</wsdl:operation>
<wsdl:operation name="synchronousInvoke">
<wsdl:input message="impl:synchronousInvokeRequest"
name="synchronousInvokeRequest"/>
<wsdl:output message="impl:synchronousInvokeResponse"
name="synchronousInvokeResponse"/>
</wsdl:operation>
<wsdl:operation name="getResults">
<wsdl:input message="impl:getResultsRequest"
name="getResultsRequest"/>
<wsdl:output message="impl:getResultsResponse"
name="getResultsResponse"/>
</wsdl:operation>
<wsdl:operation name="getStatus">
<wsdl:input message="impl:getStatusRequest"
name="getStatusRequest"/>
<wsdl:output message="impl:getStatusResponse"
name="getStatusResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="getXMLDataSoapBinding" type="impl:getXMLData">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="invoke">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="invokeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="invokeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="synchronousInvoke">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="synchronousInvokeRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="synchronousInvokeResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getResults">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getResultsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getResultsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getStatus">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getStatusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getStatusResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</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>

Apr 27 '06 #2

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

"Alvin Bruney" wrote:
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
-------------------------------------------------------

Apr 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.