Re: Multidimensionality in SOAPLite
"Chen, Li (Research, YOH)" <[email protected]> Mon, 14 Jul 2003 15:00:06 -0400
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Eric,
It didn't work (didn't change the format of the message at all),
then I tried
@attributes= SOAP::Data->type("SOAP-ENC:Array" => "First Name", "Middle
Name", "Last Name")->name('arg0');
and it still didn't work because the message is now:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<namesp1:getPersonData xmlns:namesp1="myService">
<SOAP-ENC:Array xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:string[3]">
<arg0 xsi:type="xsd:string">First Name</arg0>
<arg0 xsi:type="xsd:string">Middle Name</arg0>
<arg0 xsi:type="xsd:string">Last Name</arg0>
</SOAP-ENC:Array>
<SOAP-ENC:Array xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:string[1]">
<item xsi:type="xsd:string"/>
</SOAP-ENC:Array>
<SOAP-ENC:Array xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:string[1]">
<item xsi:type="xsd:string">myApplication</item>
</SOAP-ENC:Array>
</namesp1:getPersonData>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So the arg0 substituted the "item" element instead of the right element
(which should be "SOAP-ENC:Array" element).
Any ideas or sources I can dig into to figure that out? I believe there has
to be some "overriding" control where you can just specific your SOAP
message in Perl to any arbitrary degree?
Thanks!
Lee
-----Original Message-----
From: Eric Amick [mailto:[email protected]]
Sent: Monday, July 14, 2003 2:49 PM
To: [email protected]
Subject: Re: [SOAP] Multidimensionality in SOAPLite
On Mon, 14 Jul 2003 13:17:10 -0400, you wrote:
>Hi Eric,
> Thanks! Your recommendation worked, albeit I had to change a piece
>of it. Here is what the XML output looks like (from the client) once I
>passed references to the arrays instead:
>It seems that the name SOAP-ENC:Array is causing
>java.lang.ArrayStoreException on the server side (an Axis implementation
>there)...so I changed the message manually (inside TCP Monitor, which lets
>you change the raw message and test-send again) to:
>
>POST /axis/services/ HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close
>Accept: text/xml Accept: multipart/* Host: localhost User-Agent:
>SOAP::Lite/Perl/0.55 Content-Length: 1291
>Content-Type: text/xml; charset=utf-8 SOAPAction: "myService#getPersonData"
><?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <SOAP-ENV:Body>
> <namesp1:getPersonData xmlns:namesp1="myService">
> <arg0 xsi:type="SOAP-ENC:Array"
>SOAP-ENC:arrayType="xsd:string[3]">
> <item xsi:type="xsd:string">First Name</item>
> <item xsi:type="xsd:string">Middle Name</item>
> <item xsi:type="xsd:string">Last Name</item>
> </arg0>
> <arg1 xsi:type="SOAP-ENC:Array"
>SOAP-ENC:arrayType="xsd:string[1]">
> <item xsi:type="xsd:string"/>
> </arg1>
> <arg2 xsi:type="SOAP-ENC:Array"
>SOAP-ENC:arrayType="xsd:string[1]">
> <item xsi:type="xsd:string">myApplication</item>
> </arg2>
> </namesp1:getPersonData>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>So instead of <SOAP-ENC:Array... we have <arg0...> and so on. And this
>worked!
>
>One more question though, how do I make SOAPLite to generate arg0, etc. for
>that specific sub-element instead of SOAP-ENC:Array?
I'm not 100% certain, but you might try changing the arguments from
plain references like
\@arrayname
to
SOAP::Data->name(arg0 => \@arrayname)
instead. I haven't tried this, but it seems likely to work.
--
Eric Amick
Columbia, MD