new to SOAP, no arrays??
Michael Matthews <[email protected]> Tue, 25 Feb 2003 16:08:28 -0500
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Organization | AT&T Frame Relay |
| Message-ID | <[email protected]> |
Hi!
I am new to SOAP but am accomplished developer. I am preparing to use a
new product that uses the SOAP/XML API and am trying to use the
SOAP::Parser module but it will not accept the vendors input. I am
seeking advice as to how to use/augment the module for my purposes.
It appears I might have to write a handler for array type?? But the
vendor's reference is a little obscure. ANy help/advice would be greatly
appreciated. thanks...
...
> cat soapit.pl
use SOAP::Parser;
use Data::Dumper;
my $parser = SOAP::Parser->new();
$parser->parsefile($ARGV[0]);
my $headers = $parser->get_headers();
my $body = $parser->get_body();
$Data::Dumper::Purity = 1;
$Data::Dumper::Indent = 1;
$Data::Dumper::Terse = 1;
print " HEADER ***\n";
print Dumper $headers;
print " Body ***\n";
print Dumper $body
> soapit.pl vrr.xml
Duplicate accessor: item at
/usr/local/lib/perl5/site_perl/5.6.1/SOAP/GenericInputStream.pm line
167.
> cat vrr.xml
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http://www.cisco.com/cim-cx/2.0" xmlns:ns1="urn:CIM">
<soapenv:Header>
<ns0:message id="87855"
sessiontoken="D3C4845765B5B28509096833F7251713"
timestamp="2003-02-21T15:44:21.583Z" />
</soapenv:Header>
<soapenv:Body>
<ns1:enumerateInstancesResponse>
<returns xsi:type="ns1:CIMReturnList"
soapenc:arrayType="ns1:CIMReturn[]">
<record>
<objectPath xsi:type="ns1:CIMObjectPath">
<className xsi:type="xsd:string">Region</className>
<properties xsi:type="ns1:CIMPropertyList"
soapenc:arrayType="ns1:CIMProperty[]">
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Name</name>
<value xsi:type="xsd:string">NbiRegion</value>
</item>
<name xsi:type="xsd:string">Id</name>
<value xsi:type="xsd:string">1</value>
</item>
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">ContactInfo</name>
<value xsi:type="xsd:string" />
</item>
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">AsNumber</name>
<value xsi:type="xsd:string">100</value>
</item>
</properties>
</objectPath>
</record>
</record>
<record>
<objectPath xsi:type="ns1:CIMObjectPath">
<className xsi:type="xsd:string">Region</className>
<properties xsi:type="ns1:CIMPropertyList"
soapenc:arrayType="ns1:CIMProperty[]">
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Name</name>
<value xsi:type="xsd:string">Region1200</value>
</item>
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Id</name>
<value xsi:type="xsd:string">2</value>
</item>
</properties>
</objectPath>
<record>
<objectPath xsi:type="ns1:CIMObjectPath">
<className xsi:type="xsd:string">Provider</className>
<soapenv:Header>
<ns0:message id="87855"
sessiontoken="D3C4845765B5B28509096833F7251713"
timestamp="2003-02-21T15:44:21.583Z" />
</soapenv:Header>
<soapenv:Body>
<ns1:enumerateInstancesResponse>
<returns xsi:type="ns1:CIMReturnList"
soapenc:arrayType="ns1:CIMReturn[]">
<record>
<objectPath xsi:type="ns1:CIMObjectPath">
<className xsi:type="xsd:string">Region</className>
<properties xsi:type="ns1:CIMPropertyList"
soapenc:arrayType="ns1:CIMProperty[]">
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Name</name>
<value xsi:type="xsd:string">NbiRegion</value>
</item>
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Id</name>
<value xsi:type="xsd:string">1</value>
</item>
</properties>
</objectPath>
<record>
<objectPath xsi:type="ns1:CIMObjectPath">
<className xsi:type="xsd:string">Provider</className>
<properties xsi:type="ns1:CIMPropertyList"
soapenc:arrayType="ns1:CIMProperty[]">
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Name</name>
<value xsi:type="xsd:string">NbiProvider</value>
</item>
<item xsi:type="ns1:CIMProperty">
<properties xsi:type="ns1:CIMPropertyList"
soapenc:arrayType="ns1:CIMProperty[]">
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Name</name>
<value xsi:type="xsd:string">NbiProvider</value>
</item>
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">Id</name>
<value xsi:type="xsd:string">1</value>
</item>
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">ContactInfo</name>
<value xsi:type="xsd:string" />
</item>
<item xsi:type="ns1:CIMProperty">
<name xsi:type="xsd:string">AsNumber</name>
<value xsi:type="xsd:string">100</value>
</item>
</properties>
</objectPath>
</record>
</record>
</returns>
</ns1:enumerateInstancesResponse>
</soapenv:Body>
</soapenv:Envelope>
--
Michael Matthews
You can read messages from the SOAP archive, unsubscribe from SOAP, or subscribe to other
DevelopMentor lists at http://discuss.develop.com.