I am trying to write a simple SOAP client using SOAP :: Lite . After executing the request, the answer only seems to be parsed down a couple of levels in the perl data structure. After that, this is just a string of the remaining XML. I feel that it would be really kludgy to take this line and parse it manually using another XML parsing.
my $response = $soap->getVersionInfo;
my $data = $response->dataof('//getVersionInfoResponse');
The SOAP response looks like this in the SOAP :: Lite 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.6</Version>
</JChem>
<Java>
<Vendor>Sun Microsystems Inc.</Vendor>
<VmName>Java HotSpot(TM) Client VM</VmName>
<Version>1.6.0_05</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 is parsed in $datalooks like this (from Data :: Dumper :: Concise):
\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 answers, it can be a huge problem for parsing this XML.
SOAP:: Lite ( 2003!), :
, , SOAP .
, , , . SOAP:: Lite XML , ? ?
UPDATE:
, SOAP:: Lite - . ,
: <ns:return> . (, xml < , < ). .
, , , . SOAP:: Lite, , , . , . . , , < <, right? ?; _;
XML:: LibXML, . SOAP:: Lite XML, ?