ismaeljgm has asked for the wisdom of the Perl Monks concerning the following question:

Hi I'm trying to write a soap client using soap::lite that make use of a .wsdl file,
I've looked at some examples and have been able to get a response.
The problem I'm having is that what gets returned is an array of objects and I don't how to get the info out.
If i print what comes back from the call i get this ::workorders=HASH(0x21054dc).
How do I convert this into a perl object that I can query, I've looked at using SOAP::Data and SOAP::Data::ComplexType
but I'm not sure of where to start.
The code that i run looks like this
use SOAP::Lite; my $input = SOAP::Data->name('SCID') ->value('2634244'); my $workorder = SOAP::Lite->service('http://vspclearcbuild.vodacom.cor +p/clearquest/byServiceCallID.WSDL') -> byServiceCallID($input); print "$workorder\n";\n
The Section of the wsdl that defines what I get back is this part
<xsd:complexType name="__workorders"> <xsd:sequence> <xsd:element name="workorder" nillable="true" type="tns:ArrayOf__worko +rder"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="__workorder"> <xsd:sequence> <xsd:element name="oid" nillable="true" type="xsd:string"/> <xsd:element name="id" nillable="true" type="xsd:string"/> <xsd:element name="description" nillable="true" type="xsd:string" +/> <xsd:element name="assignToPerson" nillable="true" type="xsd:stri +ng"/> <xsd:element name="assignToWG" nillable="true" type="xsd:string"/ +> <xsd:element name="information" nillable="true" type="xsd:string" +/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ArrayOf__workorder"> <xsd:complexContent> <xsd:restriction base="SOAP_ENC:Array"> <xsd:attribute ref="SOAP_ENC:arrayType" wsdl:arrayType="tns:__wo +rkorder[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType>

Replies are listed 'Best First'.
Re: Struggling with SOAP::Lite
by nikosv (Deacon) on May 14, 2009 at 18:10 UTC
    try print $workorder->result