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

6386AW: [soaplite] Why does Soap::Lite stop parsing this response?

Expand Messages
  • Martin Busik
    Nov 9, 2009
      Hi,
      which SOAP::Lite Version are you using?

      I've tried your example with 0.69 as well as with 0.710.10.

      The result of the 0.69 differs from the result of 0.710.10, but also differs
      from your code.
      (The difference between 0.69 and 0.710.10 is, that in 0.710.10 there is an
      instance of SOAP::Data for
      every xml element returned, i.e. for JChem, Os, Java etc, where the 0.69
      returned just getVersionInfoResponse as
      a SOAP::Data instance)

      Cheers,
      Martin


      > -----Urspr√ľngliche Nachricht-----
      > Von: soaplite@yahoogroups.com
      > [mailto:soaplite@yahoogroups.com] Im Auftrag von Wes Malone
      > Gesendet: Montag, 9. November 2009 01:47
      > An: soaplite@yahoogroups.com
      > Betreff: [soaplite] Why does Soap::Lite stop parsing this response?
      >
      > I'm trying to write a simple SOAP client. After making a request, the
      > response only seems to be parsed into perl data structure a couple
      > levels down. After that it's just a string of the remaining XML. I
      > feel like it would be really kludgy to take that string and parse it
      > manually with another XML parser.
      >
      > > my $response = $soap->getVersionInfo;
      > > my $data = $response->dataof('//getVersionInfoResponse');
      >
      >
      > The SOAP response looks like this in the trace:
      >
      > > <?xml version='1.0' encoding='utf-8'?>
      > > <soapenv:Envelope
      > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      > > <soapenv:Body>
      > > <ns:getVersionInfoResponse
      > xmlns:ns="http://webservice.jchem.chemaxon">
      > > <ns:return>
      > > <Info>
      > > <JChem>
      > > <Version>5.2.1</Version>
      > > </JChem>
      > > <Java>
      > > <Vendor>Sun Microsystems Inc.</Vendor>
      > > <VmName>Java HotSpot(TM) Server VM</VmName>
      > > <Version>1.6.0_06</Version>
      > > </Java>
      > > <Os>
      > > <Arch>x86</Arch>
      > > <Name>Windows XP</Name>
      > > <Version>5.1</Version>
      > > </Os>
      > > </Info>
      > > </ns:return>
      > > </ns:getVersionInfoResponse>
      > > </soapenv:Body>
      > > </soapenv:Envelope>
      >
      > But what gets parsed into $data looks like this:
      >
      > > \bless( {
      > > _attr => {},
      > > _name => "getVersionInfoResponse",
      > > _prefix => "ns",
      > > _signature => [],
      > > _uri => "http://webservice.jchem.chemaxon",
      > > _value => [
      > > {
      > > return =>
      > "<Info>\n<JChem>\n<Version>5.2.6</Version>\n</JChem>\n<Java>\n
      > <Vendor>Sun Microsystems Inc.</Vendor>\n<VmName>Java
      > HotSpot(TM) Client
      > VM</VmName>\n<Version>1.6.0_05</Version>\n</Java>\n<Os>\n<Arch
      > >x86</Arch>\n<Name>Windows
      > XP</Name>\n<Version>5.1</Version>\n</Os>\n</Info>\n"
      > > }
      > > ]
      > > }, 'SOAP::Data' )
      >
      > This is a simple example, but for more complex responses, it could
      > become a huge hassle to have to parse out that XML.
      >
      > I found this post
      > (http://tech.groups.yahoo.com/group/soaplite/message/2641) on the
      > mailing list (from 2003!) that had a worrisome quote on it:
      >
      > > Keep in mind the requirement that any
      > > attributes not natively known to SOAP
      > > must be namespace-qualified.
      >
      > And I noticed that everything that wasn't getting parsed was not
      > namespaced. Is there a way to force SOAP::Lite to parse that
      > non-namespaced xml? Is that even the problem?
      >
      > Thanks,
      > Wes
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Show all 4 messages in this topic