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

SOAP::Lite server trouble returning COMPLEX TYPES -- HELP!

Expand Messages
  • aroth816
    I ve got a SOAP::Lite server running and I ve been testing out the use of complex objects. Here is the object defenition in the WSDL file:
    Message 1 of 1 , Jun 22, 2002
    • 0 Attachment
      I've got a SOAP::Lite server running and I've been testing out the
      use of complex objects. Here is the object defenition in the WSDL
      file:

      <xsd:complexType name="ResultElement">
      <xsd:all>
      <xsd:element name="title" type="xsd:string"/>
      <xsd:element name="item" type="xsd:int"/>
      </xsd:all>
      </xsd:complexType>

      <message name="getTitleRequest">
      <part name="item" type="s:int" />
      </message>

      <message name="getTitleResponse">
      <part name="return" type="typens:ResultElement" />
      </message>

      And here is an example perl sub that is called:

      sub getTitle(){
      return SOAP::Data->type('ResultElement')->name('title')->value("A");
      }

      But the problem should be obvious:

      1. Even if this did work correctly, it is only returning a value for
      the 'title' of the ResultElement object. How do I return both the
      title andthe item?

      2. I am using C# and .NET to write a soap client. Here is the code
      that accesses the function to return this complex object:

      WebReference1.eb eb = new WebReference1.eb();
      String title = eb.getTitle(123456).title;
      int item = eb.getItem().item;


      While this does not crash (which means its receiving an object of the
      correct type!), title and item are empty... as if no data was really
      sent although a ResultElement object seemed to have been recv'd.


      So, my main question would have to be -- how do I use SOAP::Lite to
      return a complex data type with more than 1 field (ie: ResultElement
      had 2 fields -- title and int).

      Thanks,
      Adam Roth
    Your message has been successfully submitted and would be delivered to recipients shortly.