Re: SOAP::Lite client and .NET server, array return

Jim Murphy <[email protected]>
Newsgroups gmane.comp.windows.devel.soap.general
Organization Ironring Software
Message-ID <002101c2540e$8a119a80$152aa8c0@Manta>
There are 2 prominent encoding models for SAOP messages, RPC/encoded and
Document/Literal.  .NET uses Doc/Literal by default which uses the XML
type system for things like arrays.  What you see in the WSDL is an XML
schema definition for the array of records.

You can change the encoding style to use RPC/encoded, ehich makes use of
SOAP-ENC:arrayType.  To do that, decorate your WebMethod with a
SoapRpcMethodAttribute.  See the doc for details. :)

Good Luck,
Jim

> -----Original Message-----
> From: Discussion of implementing SOAP applications today
> [mailto:[email protected]] On Behalf Of Gordon Henriksen
> Sent: Tuesday, September 03, 2002 9:49 PM
> To: [email protected]
> Subject: [SOAP] SOAP::Lite client and .NET server, array return
>
> I'm having a problem with a .NET server and a SOAP::Lite client. I've
> searched with Google and on this list's archives, but found no help.
> Both of these programs are under my complete control, but my deadline
is
> short and the SOAP interface must be frozen soon.
>
> When deserializing the return array, the SOAP::Lite client is
> eliminating all but the last of my array elements. For example, given
> this SOAP response from the .NET server:
>
>   /*  C#:
>
>       public class record {
>           int               field;
>       }
>
>       [WebMethod]
>       void Example(
>           output record[]   anArray,
>           output boolean    aBool)
>       {
>           ...
>       }
>    */
>
>   <soap:Envelope xmlns...xmlns...xmlns... >
>     <soap:Body>
>       <MethodResponse xmlns="http://example.com/">
>         <anArray>
>           <record>
>             <field>1</field>
>           </record>
>           <record>
>             <field>2</field>
>           </record>
>           <record>
>             <field>3</field>
>           </record>
>         </anArray>
>         <aBool>false</aBool>
>       </MethodResponse>
>     <soap:Body>
>   <soap:Envelope>
>
> I'm not skipping any attributes (except the namespaces); this is
> structurally how the response from the .NET server looks, according to
> SOAP::Lite (using "on_debug => sub { print @_ }").
>
> However, SOAP::Lite is deserializing this:
>
>   {
>     record => {
>       field => 3,
>     },
>     aBool => "false"
>   }
>
> I'm a little bit befuddled. Obviously, .NET isn't using a
> SOAP-ENC:arrayType attribute. Shouldn't it be? If so, does anyone know
> what do I need to do to make it do so?
>
> Acknowledging that "SOAP::Lite does not support complex types," .NET's
> WSDL for this structure is as follows:
>
>   <definitions xmlns...xmlns...xmlns >
>     ...
>     <types>
>       <s:schema elementFormDefault="qualified"
> targetNamespace="http://example.com/">
>         ...
>         <s:complexType name="LookupSecurity2Results">
>           <s:sequence>
>             <s:element minOccurs="0" maxOccurs="1" name="profiles"
> type="s0:ArrayOfSecurityProfile" />
>             <s:element minOccurs="1" maxOccurs="1" name="overflow"
> type="s:boolean" />
>           </s:sequence>
>         </s:complexType>
>         <s:complexType name="ArrayOfSecurityProfile">
>           <s:sequence>
>             <s:element minOccurs="0" maxOccurs="unbounded"
>                        name="SecurityProfile" nillable="true"
> type="s0:SecurityProfile" />
>           </s:sequence>
>         </s:complexType>
>         <s:complexType name="SecurityProfile">
>           <s:sequence>
>             <s:element minOccurs="1" maxOccurs="1" name="field"
> type="s:int" />
>           </s:sequence>
>         </s:complexType>
>         ...
>       </s:schema>
>     </types>
>     ...
>   </definitions>
>
> --
>
> Gordon Henriksen
> IT & Engineering
> ICLUBcentral Inc.
> [email protected]
>
> You can read messages from the SOAP archive, unsubscribe from SOAP, or
> subscribe to other
> DevelopMentor lists at http://discuss.develop.com.

You can read messages from the SOAP archive, unsubscribe from SOAP, or subscribe to other
DevelopMentor lists at http://discuss.develop.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.