logo       

SOAP::Lite client and .NET server, array return: msg#00003

windows.devel.soap.general

Subject: 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.
gordon@xxxxxxxxx

You can read messages from the SOAP archive, unsubscribe from SOAP, or
subscribe to other
DevelopMentor lists at http://discuss.develop.com.



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise