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

909array of struct

Expand Messages
  • John Liu
    Oct 15, 2001
    • 0 Attachment
      Hi, there,

      Tony provided an example of sending a struct
      from SOAP::Lite.

      I tried to test echoStructArray use the php SOAPx4 endpoint,
      I couldnot make it work:

      use SOAP::Lite +trace;

      SOAP::Data->import('name');

      my %hash = (
      varInt => 5,
      varString => "test string",
      varFloat => 6.2
      );

      my %hash2 = (
      varInt => 5,
      varString => "test string2",
      varFloat => 6.2
      );


      push (@arr, \%hash, \%hash2);

      $h=SOAP::Lite
      -> uri('http://soapinterop.org/')
      -> proxy('http://dietrich.ganx4.com/soapx4/soap.php')
      -> echoStructArray(name("testStruct" => \@arr));
      ...

      the trace:
      SOAP::Transport::new: ()
      SOAP::Serializer::new: ()
      SOAP::Deserializer::new: ()
      SOAP::Parser::new: ()
      SOAP::Lite::new: ()
      SOAP::Transport::HTTP::Client::new: ()
      SOAP::Data::new: ()
      SOAP::Lite::call: ()
      SOAP::Serializer::envelope: ()
      SOAP::Serializer::envelope: echoStructArray SOAP::Data=HASH(0x82906c0)
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Data::new: ()
      SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x83aeea8)
      SOAP::Transport::HTTP::Client::send_receive: POST
      http://dietrich.ganx4.com/soapx4/soap.php
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 987
      Content-Type: text/xml; charset=utf-8
      SOAPAction: "http://soapinterop.org/#echoStructArray"

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      xmlns:namesp1="http://xml.apache.org/xml-soap"><SOAP-ENV:Body><namesp2:echoS
      tructArray xmlns:namesp2="http://soapinterop.org/"><testStruct
      SOAP-ENC:arrayType="namesp1:SOAPStruct[2]" xsi:type="SOAP-ENC:Array"><item
      xsi:type="namesp1:SOAPStruct"><varFloat
      xsi:type="xsd:float">6.2</varFloat><varString xsi:type="xsd:string">test
      string</varString><varInt xsi:type="xsd:int">5</varInt></item><item
      xsi:type="namesp1:SOAPStruct"><varFloat
      xsi:type="xsd:float">6.2</varFloat><varString xsi:type="xsd:string">test
      string2</varString><varInt
      xsi:type="xsd:int">5</varInt></item></testStruct></namesp2:echoStructArray><
      /SOAP-ENV:Body></SOAP-ENV:Envelope>
      SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x84c414c)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      Connection: Close
      Date: Mon, 15 Oct 2001 22:32:00 GMT
      Server: Apache/1.3.20 (Unix) PHP/4.0.6 mod_gzip/1.3.19.1a
      Content-Length: 899
      Content-Type: text/xml; charset=UTF-8
      Client-Date: Mon, 15 Oct 2001 22:37:07 GMT
      Client-Peer: 64.65.61.213:80
      Status: 200
      X-Powered-By: PHP/4.0.6

      <?xml version="1.0"?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:si="http://soapinterop.org/xsd"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
      <echoStructArrayResponse>
      <echoStructArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType=":struct[2]">
      <item>
      <varFloat xsi:type="xsd:float">6.2</varFloat>
      <varString xsi:type="xsd:string">test string</varString>
      <varInt xsi:type="xsd:int">5</varInt>
      </item>
      <item>
      <varFloat xsi:type="xsd:float">6.2</varFloat>
      <varString xsi:type="xsd:string">test string2</varString>
      <varInt xsi:type="xsd:int">5</varInt>
      </item>
      </echoStructArray>
      </echoStructArrayResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      SOAP::Deserializer::deserialize: ()
      SOAP::Parser::decode: ()
      Unspecified namespace for type ':struct[2]'
      <?xml version="1.0"?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:si="http://soapinterop.org/xsd"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
      <echoStructArrayResponse>
      <echoStructArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType=":struct[2]">
      <item>
      <varFloat xsi:type="xsd:float">6.2</varFloat>
      <varString xsi:type="xsd:string">test string</varString>
      <varInt xsi:type="xsd:int">5</varInt>
      </item>
      <item>
      <varFloat xsi:type="xsd:float">6.2</varFloat>
      <varString xsi:type="xsd:string">test string2</varString>
      <varInt xsi:type="xsd:int">5</varInt>
      </item>
      </echoStructArray>
      </echoStructArrayResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      at teststruct1.pl line 22
      SOAP::Lite::DESTROY: ()
      SOAP::Transport::DESTROY: ()
      SOAP::Transport::HTTP::Client::DESTROY: ()
      SOAP::Deserializer::DESTROY: ()
      SOAP::Serializer::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Data::DESTROY: ()
      SOAP::Parser::DESTROY: ()

      Can anybody help?

      Thanks.

      johnl
    • Show all 4 messages in this topic