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

Changing the behaviour of the deserialization on the server side

Expand Messages
  • F. Garzon
    Hello, I have some trouble writing a SOAP server with Soap::Lite. The SOAP client and I have agreed on a WSDL (and a schema) to communicate with each other. I
    Message 1 of 1 , Aug 25 8:09 AM
    • 0 Attachment
      Hello,

      I have some trouble writing a SOAP server with Soap::Lite. The SOAP
      client and I have agreed on a WSDL (and a schema) to communicate with
      each other. I have no problem generating the responses conforming to our
      xml schema (using SOAP::Data). But when I try to read the data received
      from the client, I don't receive what I expect.
      When the client sends this request :

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <myfunction xmlns="urn:garz">
      <InputParameter xmlns="">
      <ns1:garzMessage xmlns:ns1="urn:garz">
      <ns1:Array>
      <ns1:Item key="ignored">
      <ns1:Value>argument</ns1:Value>
      </ns1:Item>
      <ns1:Item key="ignored">
      <ns1:HashTable>
      <ns1:Item key="organizationName1">
      <ns1:Value>ACME</ns1:Value>
      </ns1:Item>
      <ns1:Item key="password">
      <ns1:Value>aG00dPassWord*</ns1:Value>
      </ns1:Item>
      <ns1:Item key="emailAddress1">
      <ns1:Value>john.doe@...</ns1:Value>
      </ns1:Item>
      <ns1:Item key="commonName1">
      <ns1:Value>John Doe</ns1:Value>
      </ns1:Item>
      </ns1:HashTable>
      </ns1:Item>
      </ns1:Array>
      </ns1:garzMessage>
      </InputParameter>
      </myfunction>
      </soapenv:Body>
      </soapenv:Envelope>

      -------

      I get this as argument in my function
      $VAR1 = [
      {
      'garzMessage' => {
      'Array' => {
      'Item' => {
      'HashTable' => {

      'Item' => {

      'Value' => 'John Doe'
      }
      }
      }
      }
      }
      }
      ];
      It looks like if the deserializer only expects to have exactly one
      element with a certain name at a particular level(ex. Item in Array). if
      there are several, only the last one goes in the resulting data
      structure. Is there a way to change this behaviour ? I would like to be
      able to retrieve in an ordered list the contained elements of a
      particular element... If I have to write my own deserializer, are there
      any sample codes I could use as a starting point ?

      Thanks in advance,

      F. Garzon
    Your message has been successfully submitted and would be delivered to recipients shortly.