H
helldiversafe-news
Hi all,
I will use a apache soap service with an .net c# client and have a
problem with an complex array:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>No Deserializer found to deserialize a ':link'
using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.</faultstring>
<faultactor>/uimxDEWeb/services/CreateLogicalDocument</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
With the wsdl tool from axis I have generated an wsdl file and imported
it with the wsdl.exe from the visual studio. With the proxy class it is
possible to call some services, but one of them expects an array of an
complex type. When the apache soap server sends the complex type array
in a response it works, but not it the c# request. The encoding is set
to rpc.
So I have send the request with an java application to compare these
and they are different:
Java Request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:createLogicalDocument
xmlns:ns1="CreateLogicalDocument"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<arg0 xmlns:ns2="urn:UIMXService"
xsi:type="ns2:CreateLogicalDocumentRequestDTO">
<document
xsi:type="ns2:LogicalDocumentDTO">
<area
xsi:type="xsd:string">A</area>
<description
xsi:type="xsd:string">TEST</description>
<function xsi:type="xsd:string"
xsi:null="true"/>
<identifier
xsi:type="ns2:LogicalDocumentIdentifierDTO">
<docId
xsi:type="xsd:string">00000000001</docId>
<sequence
xsi:type="xsd:string" xsi:null="true"/>
</identifier>
<kind
xsi:type="xsd:string">AAA</kind>
<letter xsi:type="xsd:string"
xsi:null="true"/>
<link
xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:Array" ns3:arrayType="ns2:LogicalDocumentLinkDTO[1]">
<item
xsi:type="ns2:LogicalDocumentLinkDTO">
<id
xsi:type="xsd:string">1234</id>
<typeValue
xsi:type="xsd:string">4578</typeValue>
</item>
</link>
<securityIndicator
xsi:type="xsd:string" xsi:null="true"/>
<status
xsi:type="xsd:string">V</status>
<type
xsi:type="xsd:string">TTTT</type>
</document>
<requestContext
xsi:type="ns2:RequestContextDTO">
<requestId
xsi:type="xsd:string">RID13</requestId>
</requestContext>
<sessionContext
xsi:type="ns2:MandatoryUserSessionContextDTO">
<ipAddress
xsi:type="xsd:string">0.0.0.0</ipAddress>
<rcpCode
xsi:type="xsd:string">1</rcpCode>
<sessionId
xsi:type="xsd:string">2</sessionId>
<userId
xsi:type="xsd:string">3</userId>
<userLanguage
xsi:type="xsd:string">4</userLanguage>
<userProfile
xsi:type="xsd:string">5</userProfile>
</sessionContext>
</arg0>
</ns1:createLogicalDocument>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
C# Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:UIMXService" xmlns:types="urn:UIMXService/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:createLogicalDocument xmlns:q1="CreateLogicalDocument">
<in0 href="#id1" />
</q1:createLogicalDocument>
<tns:CreateLogicalDocumentRequestDTO id="id1"
xsi:type="tns:CreateLogicalDocumentRequestDTO">
<requestContext href="#id2" />
<document href="#id3" />
<sessionContext href="#id4" />
</tns:CreateLogicalDocumentRequestDTO>
<tns:RequestContextDTO id="id2"
xsi:type="tns:RequestContextDTO">
<requestId xsi:type="xsd:string">RID1</requestId>
</tns:RequestContextDTO>
<tns:LogicalDocumentDTO id="id3"
xsi:type="tns:LogicalDocumentDTO">
<area xsi:type="xsd:string">S</area>
<description xsi:type="xsd:string">SOAP</description>
<function xsi:type="xsd:string">X</function>
<identifier href="#id5" />
<kind xsi:type="xsd:string">ABC</kind>
<letter xsi:type="xsd:string" />
<link href="#id6" />
<securityIndicator xsi:type="xsd:string" />
<status xsi:type="xsd:string">F</status>
<type xsi:type="xsd:string">DEF</type>
</tns:LogicalDocumentDTO>
<tns:MandatoryUserSessionContextDTO id="id4"
xsi:type="tns:MandatoryUserSessionContextDTO">
<ipAddress xsi:type="xsd:string">0.0.0.0</ipAddress>
<rcpCode xsi:type="xsd:string">1</rcpCode>
<sessionId xsi:type="xsd:string">2</sessionId>
<userId xsi:type="xsd:string">3</userId>
<userLanguage xsi:type="xsd:string">4</userLanguage>
<userProfile xsi:type="xsd:string">5</userProfile>
</tns:MandatoryUserSessionContextDTO>
<tns:LogicalDocumentIdentifierDTO id="id5"
xsi:type="tns:LogicalDocumentIdentifierDTO">
<docId xsi:type="xsd:string" />
</tns:LogicalDocumentIdentifierDTO>
<soapenc:Array id="id6"
soapenc:arrayType="tns:LogicalDocumentLinkDTO[1]">
<Item href="#id7" />
</soapenc:Array>
<tns:LogicalDocumentLinkDTO id="id7"
xsi:type="tns:LogicalDocumentLinkDTO">
<id xsi:type="xsd:string">123</id>
<typeValue xsi:type="xsd:string">456</typeValue>
</tns:LogicalDocumentLinkDTO>
</soap:Body>
</soap:Envelope>
Is it possible to pass an array from an c# client to an apache
webservice or is it a known issue? Does somebody have an solution for
this problem? Can I change the soap request from C#?
Many thanks in advance...
Stephan
I will use a apache soap service with an .net c# client and have a
problem with an complex array:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>No Deserializer found to deserialize a ':link'
using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.</faultstring>
<faultactor>/uimxDEWeb/services/CreateLogicalDocument</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
With the wsdl tool from axis I have generated an wsdl file and imported
it with the wsdl.exe from the visual studio. With the proxy class it is
possible to call some services, but one of them expects an array of an
complex type. When the apache soap server sends the complex type array
in a response it works, but not it the c# request. The encoding is set
to rpc.
So I have send the request with an java application to compare these
and they are different:
Java Request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:createLogicalDocument
xmlns:ns1="CreateLogicalDocument"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<arg0 xmlns:ns2="urn:UIMXService"
xsi:type="ns2:CreateLogicalDocumentRequestDTO">
<document
xsi:type="ns2:LogicalDocumentDTO">
<area
xsi:type="xsd:string">A</area>
<description
xsi:type="xsd:string">TEST</description>
<function xsi:type="xsd:string"
xsi:null="true"/>
<identifier
xsi:type="ns2:LogicalDocumentIdentifierDTO">
<docId
xsi:type="xsd:string">00000000001</docId>
<sequence
xsi:type="xsd:string" xsi:null="true"/>
</identifier>
<kind
xsi:type="xsd:string">AAA</kind>
<letter xsi:type="xsd:string"
xsi:null="true"/>
<link
xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:Array" ns3:arrayType="ns2:LogicalDocumentLinkDTO[1]">
<item
xsi:type="ns2:LogicalDocumentLinkDTO">
<id
xsi:type="xsd:string">1234</id>
<typeValue
xsi:type="xsd:string">4578</typeValue>
</item>
</link>
<securityIndicator
xsi:type="xsd:string" xsi:null="true"/>
<status
xsi:type="xsd:string">V</status>
<type
xsi:type="xsd:string">TTTT</type>
</document>
<requestContext
xsi:type="ns2:RequestContextDTO">
<requestId
xsi:type="xsd:string">RID13</requestId>
</requestContext>
<sessionContext
xsi:type="ns2:MandatoryUserSessionContextDTO">
<ipAddress
xsi:type="xsd:string">0.0.0.0</ipAddress>
<rcpCode
xsi:type="xsd:string">1</rcpCode>
<sessionId
xsi:type="xsd:string">2</sessionId>
<userId
xsi:type="xsd:string">3</userId>
<userLanguage
xsi:type="xsd:string">4</userLanguage>
<userProfile
xsi:type="xsd:string">5</userProfile>
</sessionContext>
</arg0>
</ns1:createLogicalDocument>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
C# Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:UIMXService" xmlns:types="urn:UIMXService/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:createLogicalDocument xmlns:q1="CreateLogicalDocument">
<in0 href="#id1" />
</q1:createLogicalDocument>
<tns:CreateLogicalDocumentRequestDTO id="id1"
xsi:type="tns:CreateLogicalDocumentRequestDTO">
<requestContext href="#id2" />
<document href="#id3" />
<sessionContext href="#id4" />
</tns:CreateLogicalDocumentRequestDTO>
<tns:RequestContextDTO id="id2"
xsi:type="tns:RequestContextDTO">
<requestId xsi:type="xsd:string">RID1</requestId>
</tns:RequestContextDTO>
<tns:LogicalDocumentDTO id="id3"
xsi:type="tns:LogicalDocumentDTO">
<area xsi:type="xsd:string">S</area>
<description xsi:type="xsd:string">SOAP</description>
<function xsi:type="xsd:string">X</function>
<identifier href="#id5" />
<kind xsi:type="xsd:string">ABC</kind>
<letter xsi:type="xsd:string" />
<link href="#id6" />
<securityIndicator xsi:type="xsd:string" />
<status xsi:type="xsd:string">F</status>
<type xsi:type="xsd:string">DEF</type>
</tns:LogicalDocumentDTO>
<tns:MandatoryUserSessionContextDTO id="id4"
xsi:type="tns:MandatoryUserSessionContextDTO">
<ipAddress xsi:type="xsd:string">0.0.0.0</ipAddress>
<rcpCode xsi:type="xsd:string">1</rcpCode>
<sessionId xsi:type="xsd:string">2</sessionId>
<userId xsi:type="xsd:string">3</userId>
<userLanguage xsi:type="xsd:string">4</userLanguage>
<userProfile xsi:type="xsd:string">5</userProfile>
</tns:MandatoryUserSessionContextDTO>
<tns:LogicalDocumentIdentifierDTO id="id5"
xsi:type="tns:LogicalDocumentIdentifierDTO">
<docId xsi:type="xsd:string" />
</tns:LogicalDocumentIdentifierDTO>
<soapenc:Array id="id6"
soapenc:arrayType="tns:LogicalDocumentLinkDTO[1]">
<Item href="#id7" />
</soapenc:Array>
<tns:LogicalDocumentLinkDTO id="id7"
xsi:type="tns:LogicalDocumentLinkDTO">
<id xsi:type="xsd:string">123</id>
<typeValue xsi:type="xsd:string">456</typeValue>
</tns:LogicalDocumentLinkDTO>
</soap:Body>
</soap:Envelope>
Is it possible to pass an array from an c# client to an apache
webservice or is it a known issue? Does somebody have an solution for
this problem? Can I change the soap request from C#?
Many thanks in advance...
Stephan