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

3075constructing array response

Expand Messages
  • Jeff Schmidt
    Oct 17, 2003
      I'm rather new to both Perl and SOAP, but I can't seem to find an
      example that illustrates what I'm trying to do. I am writing a
      SOAP::Lite server that has several methods which need to respond with
      arrays of data. One is a simple array of integers, the other an array
      of structs containing a string and an integer. The relevant WSDL
      snippets are:

      <element name="searchResponse" type="ns:searchResponse"/>
      <complexType name="searchResponse">
      <element name="productID" type="xsd:int" minOccurs="1"

      <element name="searchCriteria" type="ns:searchCriteria"/>
      <complexType name="searchCriteria">
      <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
      <element name="flag" type="xsd:int" minOccurs="1" maxOccurs="1"/>

      <element name="searchCriteriaResponse"
      <complexType name="searchCriteriaResponse">
      <element name="criteria" type="ns:searchCriteria" minOccurs="1"

      How do I construct the response with SOAP::Lite? I've figured out how
      to build a 'canned' response with SOAP::Data, but I need to iterate
      over a list from a database to build the response and can't get my
      brain around using SOAP::Data or SOAP::SOM in a loop...

      A push in the right direction would be much appreciated!

      Jeffrey Schmidt, senior software architect, MultiAd
      jschmidt@..., AIM:jfsaim