|
|
|
|
|
|
| Author |
Message |
gelbeiche *nix forums beginner
Joined: 23 Apr 2005
Posts: 17
|
Posted: Thu Jul 20, 2006 7:37 pm Post subject:
SOAP::Lite and complex client call parameter
|
|
|
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 |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Mon Dec 01, 2008 8:15 pm | All times are GMT
|
|
Xbox Mod Chip | Payday Loan | Mortgage Calculator | Loans | Loans
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|