C#, Java, Apache SOAP 1.1 and Arrays?

  • Thread starter helldiversafe-news
  • Start date
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

iksrazal

(e-mail address removed) escreveu:
Hi all,

I will use a apache soap service with an .net c# client and have a
problem with an complex array:
<soapenc:Array id="id6"
soapenc:arrayType="tns:LogicalDocumentLinkDTO[1]">
<Item href="#id7" />
</soapenc:Array>

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

You can't use soap encoding, ie binding style 'rpc encoded' with .net .
Try wrapped document literal. soap encoded arrays are especially evil
and may never even be supported by the later versions of apache soap -
axis2.

HTH,
iksrazal
http://www.braziloutsource.com/
 
H

helldiversafe-news

You can't use soap encoding, ie binding style 'rpc encoded' with .net .
Try wrapped document literal. soap encoded arrays are especially evil
and may never even be supported by the later versions of apache soap -
axis2.

HTH,
iksrazal
http://www.braziloutsource.com/

hi iksrazal,

thanks for your hint, but it did not work.
If i change the encoding to wrapped literal i receive the following
error message in the constuctor of the generated proxy class:

An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll

Additional information: There was an error reflecting type
'CreateLogicalDocument.ResponseContextBaseDTO'.

Any other ideas?
Stephan
 
Joined
Jun 26, 2006
Messages
1
Reaction score
0
Did you find the solution to this issue? I have added a web reference to my C# WinForm application. The type for the webservice WSDL is wrapped.

The reference.CS file was autogenerated. When I create the webservice object

CustomWebService.TestService1 myWebService;
myWebService = new CustomWebService.TestService1();

I receive an exception error:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll

There was an error reflecting type....

Any idea what I could try next?

Thanks
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top