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

Maintaining Data Types in Complex Structures

Expand Messages
  • Neil Quiogue
    Hello, How does one maintain the data type of a returned complex structure? Part of the response from a request returns:
    Message 1 of 1 , Sep 27, 2004
    • 0 Attachment
      Hello,

      How does one maintain the data type of a returned complex structure?

      Part of the response from a request returns:

      <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmls
      oap.org/soap/encoding/" xsi:type="ns1:SoapObject" xmlns:soapenc="http://schemas
      .xmlsoap.org/soap/encoding/" xmlns:ns1="http://mysoap.server">
      <id xsi:type="xsd:string">1234567890</id>
      <date xsi:type="xsd:dateTime">2002-04-04T03:32:28.829Z</date>
      <activate xsi:type="xsd:boolean">false</activate>
      </multiRef>

      So let's say I got the object as $result.

      $result = $soap->call($method => @params)->result;

      But when I reference the object again, the dateTime data type becomes
      string and the activate data type becomes int. Therefore there's a
      data type mismatch when I pass the complex structure again as the
      component data types have changed.

      The only method I can think of is to pass the structure by specifying
      each data type like:
      SOAP::Data->name('id' =>
      SOAP::Data->type('xsd:string' =>
      $result->{id})),
      SOAP::Data->name('date' =>
      SOAP::Data->type('xsd:dateTime' =>
      $result->{date})),
      SOAP::Data->name('activate' =>
      SOAP::Data->type('xsd:boolean' =>
      $result->{activate}))

      So going back to my question, is there any other way of maintaining
      the data type of the components in a complex structure?

      Regards, Neil
    Your message has been successfully submitted and would be delivered to recipients shortly.