Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

C#, Java, Apache SOAP 1.1 and Arrays?

Thread view: 
helldiversafe-news@yahoo.de - 04 Jan 2006 12:34 GMT
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
iksrazal@gmail.com - 04 Jan 2006 13:37 GMT
> Hi all,
>
> I will use a apache soap service with an .net c# client and have a
> problem with an complex array:
<snip>

>          <soapenc:Array id="id6"
> soapenc:arrayType="tns:LogicalDocumentLinkDTO[1]">
[quoted text clipped - 6 lines]
> 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/
helldiversafe-news@yahoo.de - 05 Jan 2006 16:43 GMT
iksrazal@gmail.com schrieb:
> You can't use soap encoding, ie binding style 'rpc encoded' with .net .
> Try wrapped document literal. soap encoded arrays are especially evil
[quoted text clipped - 4 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.