SOAP::Lite and complex client call parameter

G

gelbeiche

Hi,

I use SOAP::Lite for a client to call some Java-based webservices.
All is fine as long as the signature of the webservice use simple
parameters.
But now I have to call a webservice which has an parameter that is an
array of complex data (in C I would say an array of structs, in Java
it is called array of valueobjects).
Actually it is an order with some order details. The raw XML-picture
would look like:
<order>
<customernumber>1</customernumber>
<company>2</company>
<orderdetails>
<orderdetail>
<...> //some order detail data here
<orderdetail>
<orderdetail>
<...> //some order detail data here
<orderdetail>
</orderdetails>
</order>

The customernumber and company are simple data types,
the orderdetails are an array of orderdetail.

I tried the following:
my $soap_response = SOAP::Lite
-> proxy($webservice_address)
-> uri($uri)
->
receiveOrder(SOAP::Data->type(string=>"my_externelCustNo")->name('string'),
SOAP::Data->type(string=>"my_externalOrderNo")->name('string0'),
SOAP::Data->type(byte=>1)->name('byteVal'),
SOAP::Data->type(byte=>2)->name('byteVal0'),
SOAP::Data->type(byte=>3)->name('byteVal1'),
SOAP::Data->name(orderDetailVOs=>"<orderDetailVOs
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:n1=\"java:valueobjects.shared.online\"
soapenc:arrayType=\"n1:OrderDetailVO[1]\">
<OrderDetailVO xsi:type=\"n1:OrderDetailVO\">
<comunicatedDeliveryType
xsi:type=\"xsd:byte\">1</comunicatedDeliveryType> <confirmationID
href=\"#ID_4\"> </confirmationID>
<itemNumber xsi:type=\"xsd:int\">100</itemNumber>
<orderType xsi:type=\"xsd:byte\">1</orderType>
<paymentCondition href=\"#ID_4\"> </paymentCondition>
<promotion href=\"#ID_4\"></promotion>
<quantity xsi:type=\"xsd:int\">100</quantity>
<sellingPrice xsi:type=\"xsd:int\">100</sellingPrice>
<size href=\"#ID_4\"> </size>
</OrderDetailVO> <xsd:string xsi:type=\"xsd:string\"
id=\"ID_4\">sample string</xsd:string>
</orderDetailVOs>"));

When I call the webservice I get no error. When I look at the webservice
server side I see that the simple data are properly transmitted to the
server but the data in the XML structure are not.
The method at Java side which is called has a signature:

int receiveOrder(String extCustNo, String
extOrderNo, ...,OrderDetailVO[] orderDetails);

and when I access the orderDetails-array it contains no values.

What I'm doing wrong and where can I find an client example which uses
arrays of data structures ?

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top