F
Florian Grousset
Hi,
I'm trying to code a simple C# SOAP client wich query an Axis2 Java SOAP
Server.
Server side code has been generated from a WSDL file.
SOAP requests and responses must both contain a simple String array (not
very diffucult I think !).
What I've done :
1. WSDL file writing (see at the bottom of this post)
2. Generate Java server code with Axis2 tools and deploy it in tomcat
j2ee application server.
3. In visual Studio 2005, add the web ressource using the WSDL url. It
rightly build all my objects.
4. write a simple C# client to to a request/response but when I launch
it it crashes on the client side.
I've tried to use a simple query in the SOAP query (keeping the String
array in the response) and it works !
Are complex objects like String[] allowed in the requests ?
Here is the client error and my WSDL file...
Any help would be appreciated.
-------------
ERROR :
-------------
Exception:
à
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message,
WebResponse response, Stream responseStream, Boolean asyncCall)
à System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName,
Object[] parameters)
à ExaleadOEMClient_CSharp.madpc016.ExaleadService.admin(adminElement
adminElement)
dans C:\test\xxxxxx\Web References\madpc016\Reference.cs:ligne 116
à ExaleadOEMClient_CSharp.Program.exaleadAdmin() dans
C:\xxxxxx\Program.cs:ligne 51
-------------
WSDL :
-------------
<?xml version="1.0" encoding="UTF-8"?>
<definitions
name="TestService"
targetNamespace="http://test"
xmlns:tns="http://test"
xmlns:ns2="http://test/types"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<schema targetNamespace="http://test/types"
xmlns:tns="http://test/types"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<element name="adminElement">
<complexType>
<sequence>
<element name="adminRequestArray" type="xsd:string"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
<element name="returnAdminElement">
<complexType>
<sequence>
<element name="adminResponseArray" type="xsd:string"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="Test_admin">
<part name="parameters" element="ns2:adminElement"/>
</message>
<message name="Test_adminResponse">
<part name="result" element="ns2:returnAdminElement"/>
</message>
<portType name="Test">
<operation name="admin">
<input message="tns:Test_admin" name="Test_admin"/>
<output message="tns:Test_adminResponse" name="Test_adminResponse"/>
</operation>
</portType>
<binding name="TestBinding" type="tns:Test">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<operation name="admin">
<soapperation soapAction="admin"/>
<input name="Test_admin">
<soap:body use="literal"/>
</input>
<output name="Test_adminResponse">
<soap:body use="literal"/>
</output>
</operation>
<operation name="search">
<soapperation soapAction="search"/>
<input name="Test_search">
<soap:body use="literal"/>
</input>
<output name="Test_searchResponse">
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TestService">
<port name="TestPort" binding="tns:TestBinding">
<soap:address
location="http://localhost:8080/axis2/services/TestService"/>
</port>
</service>
</definitions>
I'm trying to code a simple C# SOAP client wich query an Axis2 Java SOAP
Server.
Server side code has been generated from a WSDL file.
SOAP requests and responses must both contain a simple String array (not
very diffucult I think !).
What I've done :
1. WSDL file writing (see at the bottom of this post)
2. Generate Java server code with Axis2 tools and deploy it in tomcat
j2ee application server.
3. In visual Studio 2005, add the web ressource using the WSDL url. It
rightly build all my objects.
4. write a simple C# client to to a request/response but when I launch
it it crashes on the client side.
I've tried to use a simple query in the SOAP query (keeping the String
array in the response) and it works !
Are complex objects like String[] allowed in the requests ?
Here is the client error and my WSDL file...
Any help would be appreciated.
-------------
ERROR :
-------------
Exception:
à
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message,
WebResponse response, Stream responseStream, Boolean asyncCall)
à System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName,
Object[] parameters)
à ExaleadOEMClient_CSharp.madpc016.ExaleadService.admin(adminElement
adminElement)
dans C:\test\xxxxxx\Web References\madpc016\Reference.cs:ligne 116
à ExaleadOEMClient_CSharp.Program.exaleadAdmin() dans
C:\xxxxxx\Program.cs:ligne 51
-------------
WSDL :
-------------
<?xml version="1.0" encoding="UTF-8"?>
<definitions
name="TestService"
targetNamespace="http://test"
xmlns:tns="http://test"
xmlns:ns2="http://test/types"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<schema targetNamespace="http://test/types"
xmlns:tns="http://test/types"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<element name="adminElement">
<complexType>
<sequence>
<element name="adminRequestArray" type="xsd:string"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
<element name="returnAdminElement">
<complexType>
<sequence>
<element name="adminResponseArray" type="xsd:string"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="Test_admin">
<part name="parameters" element="ns2:adminElement"/>
</message>
<message name="Test_adminResponse">
<part name="result" element="ns2:returnAdminElement"/>
</message>
<portType name="Test">
<operation name="admin">
<input message="tns:Test_admin" name="Test_admin"/>
<output message="tns:Test_adminResponse" name="Test_adminResponse"/>
</operation>
</portType>
<binding name="TestBinding" type="tns:Test">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<operation name="admin">
<soapperation soapAction="admin"/>
<input name="Test_admin">
<soap:body use="literal"/>
</input>
<output name="Test_adminResponse">
<soap:body use="literal"/>
</output>
</operation>
<operation name="search">
<soapperation soapAction="search"/>
<input name="Test_search">
<soap:body use="literal"/>
</input>
<output name="Test_searchResponse">
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TestService">
<port name="TestPort" binding="tns:TestBinding">
<soap:address
location="http://localhost:8080/axis2/services/TestService"/>
</port>
</service>
</definitions>