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

Passing complex structure to server

Expand Messages
  • ankurb1
    Hi, I need some help on passing structures to the server using soap::Lite. ... #! /perl -w use Class::Struct; use SOAP::Lite +trace; my $ser = SOAP::Lite
    Message 1 of 1 , Dec 2, 2004
    • 0 Attachment
      Hi,

      I need some help on passing structures to the server using soap::Lite.
      My client side code is:

      ---------------------------------------------------------------------
      #! /perl -w
      use Class::Struct;
      use SOAP::Lite +trace;


      my $ser = SOAP::Lite
      ->service('file:/home/u2/abhatia/datanew/DS.wsdl');


      struct DSField => {
      name => '$',
      description => '$',
      uckid => '$',
      type => '$',
      count => '$',
      start => '$',
      len => '$',
      indexed => '$',
      endian => '$'
      };


      struct DSFieldVec => {
      ptr => 'DSField',
      size => '$'
      };


      struct attrib => {
      ptrc => '$',
      ptrv => '$'
      };


      struct StringVec => {
      ptr => '$',
      size => '$'
      };


      struct AttributeVec => {
      ptr => 'attrib',
      size => '$'
      } ;
      struct SourceInfo => {
      name => '$',
      delim => '$',
      id => '$',
      schema_id => '$',
      stype => '$',
      DSFieldVector => 'DSFieldVec',
      StrVec => 'StringVec',
      AttrVec => 'AttributeVec'
      };


      $sourceinfo = SourceInfo->new();
      $sourceinfo->name('ABCD');
      $sourceinfo->delim(',');
      $sourceinfo->id(12345);
      $sourceinfo->schema_id(2);
      $sourceinfo->stype(1);


      $sourceinfo->DSFieldVector->ptr->name('ABCD');
      $sourceinfo->DSFieldVector->ptr->description('ABCD');
      $sourceinfo->DSFieldVector->ptr->uckid(12345);
      $sourceinfo->DSFieldVector->ptr->type(0);
      $sourceinfo->DSFieldVector->ptr->count(1);
      $sourceinfo->DSFieldVector->ptr->start(1);
      $sourceinfo->DSFieldVector->ptr->len(2);
      $sourceinfo->DSFieldVector->ptr->indexed(1);
      $sourceinfo->DSFieldVector->ptr->endian(0);
      $sourceinfo->DSFieldVector->size(1);


      $sourceinfo->StrVec->ptr('ABCD');
      $sourceinfo->StrVec->size(1);


      $sourceinfo->AttrVec->ptr->ptrc('ABCD');
      $sourceinfo->AttrVec->ptr->ptrv(1);
      $ser->addDataSource($sourceinfo->DSFieldVector->ptr->name('ABCD'),
      \$sourceinfo);


      The function addDataSource is implemented in C++ on server side. It
      receives all NULL values when called.

      The soap::trace is:


      -----------------------------------------------------------
      SOAP::Lite::call: ()
      SOAP::Serializer::envelope: ()
      SOAP::Serializer::envelope: addDataSource SOAP::Data=HASH(0x859f2dc)
      SOAP::Data=HASH(0x859f360)
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      Cannot encode 'si' element as 'hash'. Will be encoded as 'map' instead
      SOAP::Data::new: ()
      Cannot encode 'value' element as 'hash'. Will be encoded as 'map' instead
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      Cannot encode 'value' element as 'hash'. Will be encoded as 'map' instead
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      Cannot encode 'value' element as 'hash'. Will be encoded as 'map' instead
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      Cannot encode 'value' element as 'hash'. Will be encoded as 'map' instead
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      Cannot encode 'value' element as 'hash'. Will be encoded as 'map' instead
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x84fc81c)
      SOAP::Transport::HTTP::Client::send_receive: POST http://localhost:18000
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 3087
      Content-Type: text/xml; charset=utf-8
      SOAPAction: ""

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:apa
      chens="http://xml.apache.org/xml-soap"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="htt p://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/19
      99/XMLSchema"><SOAP-ENV:Body><namesp1:addDataSource
      xmlns:namesp1="http://tempuri.org"><name
      xsi:type="xsd:string">ABCD</name ><si
      xsi:type="apachens:Map"><item><key
      xsi:type="xsd:string">SourceInfo::StrVec</key><value
      xsi:type="apachens:Map"><item><k ey
      xsi:type="xsd:string">StringVec::size</key><value
      xsi:type="xsd:int">1</value></item><item><key
      xsi:type="xsd:string">StringVec::ptr</key><value
      xsi:type="xsd:string">ABCD</value></item></value></item><item><key
      xsi:type="xsd:string">SourceInfo::s type</key><value
      xsi:type="xsd:int">1</value></item><item><key
      xsi:type="xsd:string">SourceInfo::AttrVec</key><value xsi:type
      ="apachens:Map"><item><key
      xsi:type="xsd:string">AttributeVec::size</key><value
      xsi:null="1"/></item><item><key xsi:type="xsd
      :string">AttributeVec::ptr</key><value
      xsi:type="apachens:Map"><item><key
      xsi:type="xsd:string">attrib::ptrv</key><value xsi:
      type="xsd:int">1</value></item><item><key
      xsi:type="xsd:string">attrib::ptrc</key><value
      xsi:type="xsd:string">ABCD</value></
      item></value></item></value></item><item><key
      xsi:type="xsd:string">SourceInfo::schema_id</key><value
      xsi:type="xsd:int">2</v alue></item><item><key
      xsi:type="xsd:string">SourceInfo::name</key><value
      xsi:type="xsd:string">ABCD</value></item><item><key
      xsi:type="xsd:string">SourceInfo::id</key><value
      xsi:type="xsd:int">12345</value></item><item><key
      xsi:type="xsd:string">SourceInfo::DSFieldVector</key><value
      xsi:type="apachens:Map"><item><key
      xsi:type="xsd:string">DSFieldVec::size</key><value
      xsi:type="xsd:int">1</value></item><item><key
      xsi:type="xsd:string">DSFieldVec::ptr</key><value
      xsi:type="apachens:Map"><it em><key
      xsi:type="xsd:string">DSField::name</key><value
      xsi:type="xsd:string">ABCD</value></item><item><key xsi:type="xsd:s
      tring">DSField::endian</key><value
      xsi:type="xsd:int">0</value></item><item><key
      xsi:type="xsd:string">DSField::type</key ><value
      xsi:type="xsd:int">0</value></item><item><key
      xsi:type="xsd:string">DSField::count</key><value xsi:type="xsd:int">1
      </value></item><item><key
      xsi:type="xsd:string">DSField::start</key><value
      xsi:type="xsd:int">1</value></item><item><key xs
      i:type="xsd:string">DSField::uckid</key><value
      xsi:type="xsd:int">12345</value></item><item><key
      xsi:type="xsd:string">DS Field::indexed</key><value
      xsi:type="xsd:int">1</value></item><item><key
      xsi:type="xsd:string">DSField::len</key><value xsi
      :type="xsd:int">2</value></item><item><key
      xsi:type="xsd:string">DSField::description</key><value
      xsi:type="xsd:string">ABCD</value></item></value></item></value></item><item><key
      xsi:type="xsd:string">SourceInfo::delim</key><value xsi:type="xsd:st
      ring">,</value></item></si></namesp1:addDataSource></SOAP-ENV:Body></SOAP-ENV:Envelope>
      SOAP::Transport::HTTP::Client::send_receive:
      HTTP::Response=HASH(0x856929c)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      Connection: close
      Server: gSOAP/2.3
      Content-Type: text/xml; charset=utf-8
      Client-Date: Thu, 02 Dec 2004 21:23:05 GMT
      Client-Response-Num: 1

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOA
      P-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www .w3.org/1999/XMLSchema"
      xmlns:ns="http://tempuri.org/ns.xsd"
      xmlns:DS="http://tempuri.org"><SOAP-ENV:Body SOAP-ENV:encodingSt
      yle="http://schemas.xmlsoap.org/soap/encoding/"
      id="_0"><DS:addDataSourceResponse><id>0</id></DS:addDataSourceResponse></SOAP
      -ENV:Body></SOAP-ENV:Envelope>
      SOAP::Deserializer::deserialize: ()
      SOAP::Parser::decode: ()
      SOAP::SOM::new: ()
      SOAP::Lite::DESTROY: ()
      SOAP::Serializer::DESTROY: ()
      SOAP::Data::DESTROY: ()

      -----------------------------------------------------------------------

      i would appreciate any help on this
    Your message has been successfully submitted and would be delivered to recipients shortly.