Loading ...
Sorry, an error occurred while loading the content.

SOAP::Lite and complex data type

Expand Messages
  • tporschb
    Hi, I want to write a webservice client script with SOAP::Lite. The webservice at server side expects first some primitive data types (a head of a customer
    Message 1 of 1 , Jul 20, 2006
    View Source
    • 0 Attachment
      Hi,

      I want to write a webservice client script with SOAP::Lite.
      The webservice at server side expects first some primitive
      data types (a head of a customer order) like xsd:byte, xsd:string...
      and then a array of complex datatypes(in C I would say structs,
      which means the details of an order).
      I created a package with stubmaker.pl from the WSDL and
      got:

      receiveOrder => {
      endpoint => 'http://porschberg.osp-dd.de:7001/webservices/
      onlineorderWS',
      soapaction => '',
      namespace => 'http://www.otto.de/noa',
      parameters => [
      SOAP::Data->new(name => 'string', type => 'partns:string', attr
      => {}),
      SOAP::Data->new(name => 'string0', type => 'partns:string',
      attr => {}),
      SOAP::Data->new(name => 'byteVal', type => 'partns:byte', attr
      => {}),
      SOAP::Data->new(name => 'byteVal0', type => 'partns:byte', attr
      => {}),
      SOAP::Data->new(name => 'byteVal1', type => 'partns:byte', attr
      => {}),
      SOAP::Data->new(name => 'orderDetailVOs', type =>
      'partns:ArrayOfOrderDetailVO', attr => {}),
      ], # end parameters
      }, # end receiveOrder

      I feed a complete XML-message string to the function as
      last parameter which represents this nested structure and get:

      Type 'ArrayOfOrderDetailVO' can't be found in a schema class
      'SOAP::Serializer'

      This is understandable because the perl module knows nothing
      about OrderDetailVO.

      I tried:
      my $soap_response = SOAP::Lite
      -> proxy($webservice_address)
      -> uri('http://www.otto.de/noa')
      -> 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=>"..."));

      where "..." stands for the whole XML string.
      This is successful sent to the webservice but I see that at server
      side the values from the last parameter (the XML string) are not
      received properly.
      Where can I find a example that deals with such non-primitive
      datatypes ?

      Thank you, Thomas
    Your message has been successfully submitted and would be delivered to recipients shortly.