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

Passing C++ style structures

Expand Messages
  • Sanjay
    Hi All, I have gSOAP c++ soap server. I want to expose some complex data structures using this server to the clients (which include gSOAP c++ ... #include
    Message 1 of 1 , Jun 20, 2003
    • 0 Attachment
      Hi All,
      I have gSOAP c++ soap server. I want to expose some complex data
      structures using this server to the clients (which include gSOAP c++
      client and SOAP::LITE perl client). One of my c++ structure look like:

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

      #include <string>
      extern class std::string;
      extern typedef std::string xsd__string;

      struct Types {
      unsigned short unsignedShortParam;
      unsigned int unsignedIntParam;
      unsigned long unsignedLongParam;
      short shortParam;
      int intParam;
      long longParam;
      char* charParam;
      xsd__string stringParam;
      };
      int ns__test(double a, double b, struct Types *inTypes_ptr, struct
      Types *outTypes_ptr);

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

      My SOAP::LITE implementation is:

      ---------------------------------------------------------------------
      $soap_response = SOAP::Lite
      -> uri('urn:sbsd')
      -> proxy('http://localhost:3000')
      ->test(
      SOAP::Data->name('a')->type(float => 12.5),
      SOAP::Data->name('b')->type(float => 11.5),
      SOAP::Data->name('InTypes_ptr' =>
      \SOAP::Data->value(
      SOAP::Data->name('unsignedShortParam')->type
      (unsignedShort => 40 ),
      SOAP::Data->name('unsignedIntParam')->type(unsignedInt
      => 3000 ),
      SOAP::Data->name('unsignedLongParam')->type(unsignedLong
      => 4000 ),
      SOAP::Data->name('shortParam')->type(short => 3000 ),
      SOAP::Data->name('intParam')->type(int => 3000 ),
      SOAP::Data->name('charParam')->type(string => 'welcome
      character' )
      ,
      SOAP::Data->name('stringParam')->type(string => 'welcome
      string' )
      )
      ));
      ---------------------------------------------------------------------

      Do you think there is another better way of passing (or getting back)
      complex structure's using SOAP::LITE? Most of the time I have to
      figure out the problem by going down to the protocol layer (i.e
      looking into the actual SOAP-XML messages). Is there any documents
      exists which describes passing structures, enums, unions etc?

      Thank you very much.
      -sanjay soman
    Your message has been successfully submitted and would be delivered to recipients shortly.