By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Receiving two-dimensional arrays from Perl through SOAP?

P: n/a
Hi,

I have succesfully connected from a dotnet client on Windows to a Perl
service and was able to send basic data types and arrays back to
Windows. However, I tried sending a two-dimensional array, and something
went wrong.

This is how I define the service in the client proxy:

[System.Web.Services.Protocols.SoapRpcMethodAttribu te("http://host/MyWebServices/SayHello",
RequestNamespace="http://host/MyWebServices/",
ResponseNamespace="http://host/MyWebServices/")]
[return: System.Xml.Serialization.SoapElementAttribute("out args")]
public string[][] SayHello() {
object[] results = this.Invoke("SayHello", new object[0]);
return ((string[][])(results[0]));
}

This is what is done in Perl on the server:

sub SayHello
{
my @ar;
push @ar, ['aaa', 'bbb', 'ccc'];
push @ar, ['ddd', 'eee', 'fff'];
return \@ar;
}

This is the error that I am getting:

[thread 0xb44] Unhandled exception generated: (0x04aaaac0)
<System.InvalidOperationException>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04aaab80) "There is an error in XML document (1, 429)."
_innerException=(0x04aa62fc) <System.InvalidOperationException>
_helpURL=<null>
_stackTrace=(0x04aaac74) array with dims=[72]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80131509
_source=<null>
_xptrs=0x00000000
_xcode=0xe0434f4d

This is the XML that is generated. Character 429 is the beginning of the
very first <SOAP-ENC:Array> tag.

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envel
ope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/"><SOAP-ENV:Body><namesp1:SayHelloResponse
xmlns:namesp1="http://shaman/MyWebServices/"><SOAP-ENC:Array
xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="SOAP-ENC:Array[2]"><item
xsi:type="SOAP-ENC:Array" SOAP-ENC:a
rrayType="xsd:string[3]"><item xsi:type="xsd:string">aaa</item><item
xsi:type="xsd:string">bbb</item><item xsi
:type="xsd:string">ccc</item></item><item xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:string[3]"><item
xsi:type="xsd:string">ddd</item><item
xsi:type="xsd:string">eee</item><item
xsi:type="xsd:string">fff</item></item></SOAP-ENC:Array></namesp1:SayHelloResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

I'll appreciate any hints if anyone has fought with this before.

Thanks,
Simon
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.