logo       
Bookmark and Share

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

windows.devel.soap.general

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

Hello, Gordon,

There's a bug in SOAP::Lite v. 0.5x, which hasn't made its way
into the released version yet. I would apply this patch manually,
as the code changed from 0.51 to 0.52. The patch assumes that if
the first two child elements have the same name, all the elements
do, and an array should be constructed. This isn't just .NET servers,
but any server returing an array of elements.

- Eric

--- Lite.bak.pm Thu Apr 4 11:06:32 2002
+++ Lite.pm Thu Apr 4 11:06:55 2002
@@ -1828,11 +1828,16 @@
return defined $class && $class ne 'Array' ? bless($res => $class) :
$res;

} elsif ($name =~ /^\{$SOAP::Constants::NS_ENC\}Struct$/ ||
!$schemaclass->can($method) && (ref $children || defined $class && $value =~
/^\s*$/)) {
- my $res = {};
$self->hrefs->{$id} = $res if defined $id;
- %$res = map {$self->decode_object($_)} @{$children || []};
- return defined $class && $class ne 'SOAPStruct' ? bless($res => $class) :
$res;
-
+ if (@{$children} > 1 && $children->[0]->[0] eq $children->[1]->[0]) {
+ my $res = [];
+ @$res = map { scalar(($self->decode_object($_))[1]) }
@{$children || []};
+ return defined $class && $class ne 'Array' ? bless($res => $class) :
$res;
+ } else {
+ my $res = {};
+ %$res = map {$self->decode_object($_)} @{$children || []};
+ return defined $class && $class ne 'Struct' ? bless($res =>
$class) : $res;

+ }
} else {
my $res;
if ($schemaclass->can($method)) {

> ------------------------------
>
> Date: Tue, 3 Sep 2002 22:49:04 -0400
> From: Gordon Henriksen <gordon@xxxxxxxxx>
> 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:
>
> [example omitted...]
>
> 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:
>
> [WSDL omitted...]
>
> --
>
> 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.
>
> ------------------------------
>
> End of SOAP Digest - 1 Sep 2002 to 3 Sep 2002 (#2002-183)
> *********************************************************

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 | Mail Home | sitemap | FAQ | advertise