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

Re: [soaplite] Problem decoding a message...

Expand Messages
  • Byrne Reese
    Please check out the latest in SOAP::Lite examples and HOWTOs at: http://www.majordojo.com/archives/000150.html http://www.majordojo.com/archives/000042.html
    Message 1 of 2 , Feb 12, 2004
    • 0 Attachment
      Please check out the latest in SOAP::Lite examples and HOWTOs at:

      http://www.majordojo.com/archives/000150.html
      http://www.majordojo.com/archives/000042.html


      > I have a problem trying to write a SOAP::Lite client to decode the
      > following
      > response from a (gSOAP) server:
      >
      >
      >>SOAP-ENV:Envelope
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      > xmlns:gvip="urn:GrapevineSubsystem"
      > xmlns:gv="urn:Grapevine"
      > SOAP-ENV:Body
      > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"gv:getNo
      > deFieldsFromIDResponsenodeInfo xsi:type="gv:MapStringString"item
      > xsi:type="gv:StringPair"name/namevalue/value/itemitem
      > xsi:type="gv:StringPair"name/namevalue/value/item/nodeInfo/gv:getNodeFieldsFromIDResponse/SOAP-ENV:Body/SOAP-ENV:Envelopeitem
      >
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      > To visit your group on the web, go
      > to:http://groups.yahoo.com/group/soaplite/
      > To unsubscribe from this group, send an email
      > to:soaplite-unsubscribe@yahoogroups.com
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >


      ^byrne :/
    • Paul Harman
      I have a problem trying to write a SOAP::Lite client to decode the following response from a (gSOAP) server:
      Message 2 of 2 , Feb 12, 2004
      • 0 Attachment
        I have a problem trying to write a SOAP::Lite client to decode the following
        response from a (gSOAP) server:


        <SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/1999/XMLSchema"
        xmlns:gvip="urn:GrapevineSubsystem"
        xmlns:gv="urn:Grapevine"
        >
        <SOAP-ENV:Body
        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><gv:getNo
        deFieldsFromIDResponse>
        <nodeInfo xsi:type="gv:MapStringString">
        <item xsi:type="gv:StringPair">
        <name>label</name>
        <value>SCIENCE Cloning</value>
        </item>
        <item xsi:type="gv:StringPair">
        <name>plainText</name>
        <value>Researchers have successfully cloned a human
        embryo to extract stem cells in what was hailed today as a major step
        forward for medical science.</value>
        </item>
        </nodeInfo>
        </gv:getNodeFieldsFromIDResponse>
        </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>


        I'm using the following code to decode this:

        my $r=$res->result;
        foreach my $k (keys %{$r})
        {
        foreach my $k2 (keys %{${$r}{$k}})
        {
        print "$k2 = ${${$r}{$k}}{$k2}\n";
        }
        }

        A bit ugly, but that seems to be how SOAP::Lite is attempting to decode
        this. Unfortunately it seems to want to de-serialise gv:MapStringString as a
        hash with just a single <item> in it, rather than as an array of <item>s,
        which would make more sense.

        So my code only ever prints out "plainText = Researchers..."; the 'label'
        parameter is lost.

        Is this a problem with the way gv:MapStringString is defined (i.e. not
        explicitly stated to be an array)? There's nothing I can do about this
        server-side, so is there a way to influence SOAP::Lite's decoding behaviour?

        Thanks in advance,

        Paul


        This E-Mail and any attachment is intended only for the person or entity for
        which it is addressed and may contain confidential material. If you are not
        the addressee or have received this E-Mail in error, please inform the
        sender immediately and delete it from your computer. In addition, if you are
        not the addressee or have received this E-Mail in error, any disclosure,
        copying, distribution or any action taken or omitted to be taken in reliance
        upon it is prohibited and may be unlawful.
        If this E-Mail has been transmitted outside the ordinary course of its
        business, the company for which the sender works accepts no liability for
        any loss or damage suffered by any person arising from any use of or
        reliance on information contained in this E-Mail, and any opinion expressed
        in this E-Mail is personal to the sender and may not reflect the opinion of
        such company. Although the network operator makes every reasonable effort to
        keep its network free from viruses, neither the network operator nor the
        sender or the company for which the sender works accepts any responsibility
        for computer viruses transmitted through this E-Mail or any attachments; it
        is your responsibility to virus scan this E-Mail and any attachments. Any
        E-Mail reply to this address may be subject to interception or monitoring
        for operational reasons or for lawful business practices.
      Your message has been successfully submitted and would be delivered to recipients shortly.