SOAP::Lite and complex client call parameter

Discussion in 'Perl Misc' started by gelbeiche, Jul 20, 2006.

  1. gelbeiche

    gelbeiche Guest

    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
     
    gelbeiche, Jul 20, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    0
    Views:
    506
  2. Aaron Brady

    SQL, lite lite lite

    Aaron Brady, Dec 29, 2008, in forum: Python
    Replies:
    15
    Views:
    761
    Aaron Brady
    Jan 1, 2009
  3. doug
    Replies:
    2
    Views:
    261
  4. Replies:
    1
    Views:
    504
    J. Gleixner
    Oct 6, 2006
  5. droesler
    Replies:
    2
    Views:
    511
    droesler
    Aug 31, 2010
Loading...

Share This Page