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

I have a simple SOAP::Lite call that work with: CrossCheck's SOAPSonar

But PERL fails to bundle the parameter: Qualifier. (Partially may be due to an older XML version needs to be used due to limitation with the server application - BMC Remedy.)

Any ideas on the disconnect? For example the PERL code:
#!/usr/bin/perl -w use strict; use SOAP::Lite; use Data::Dumper; # Create a SOAP handle to handle web service transactions with Remedy my $wsdl = 'http://SERVER/arsys/WSDL/HD_Netcool_v1'; my $soapHndl = SOAP::Lite->new()->service($wsdl)->readable(1); # Force schema type to be XMLSchema2001 my $xmlschema2001 = "http://www.w3.org/2001/XMLSchema"; $soapHndl->xmlschema($xmlschema2001); # Define tags to be nested within the <AuthenticationInfo> tag my @authObj = (SOAP::Header->name('userName')->value('user'), SOAP::Header->name('password')->value('password') ); my $qualification = "\'ucn\' LIKE \'test%\'"; my @queryObj = (SOAP::Data->name('Qualification')->value($qualificatio +n), SOAP::Data->name('startRecord')->value('0'), SOAP::Data->name('maxLimit')->value('10'), SOAP::Header->name('AuthenticationInfo')->value(\SOAP::Header->value(@ +authObj)) ); my @RemedyList = $soapHndl->OpGetList(@queryObj); my $numElements = @RemedyList; print Dumper(@RemedyList);
Generates the incorrect XML:
<?xml version=\"1.0\" encoding=\"UTF-8\"?> <soap:Envelope soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:s0=\"urn:HD_Netcool_v1\"> <soap:Header> <AuthenticationInfo> <userName xsi:type=\"xsd:string\">User</userName> <password xsi:type=\"xsd:string\">Password</password> </AuthenticationInfo> </soap:Header> <soap:Body> <s0:OpGetList> <OpGetList xsi:nil=\"true\" xsi:type=\"s0:GetListInputMap\" /> <startRecord xsi:type=\"xsd:int\">0</startRecord> <maxLimit xsi:type=\"xsd:int\">10</maxLimit> </s0:OpGetList> </soap:Body> </soap:Envelope>
The correct XML via CrossCheck's SOAPSonar is:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http +://www.w3.org/2001/XMLSchema" xmlns:s0="urn:HD_Netcool_v1"> <soap:Header> <s0:AuthenticationInfo> <s0:userName>blackberry</s0:userName> <s0:password>blackberry</s0:password> </s0:AuthenticationInfo> </soap:Header> <soap:Body> <s0:OpGetList> <s0:Qualification>'assigned_group'="Net Serv Y"</s0:Qualificatio +n> <s0:startRecord/> <s0:maxLimit/> </s0:OpGetList> </soap:Body> </soap:Envelope>
The XML is: <readmore> <wsdl:definitions targetNamespace="urn:RemedyMethod"> <wsdl:types> <xsd:schema elementFormDefault="qualified" targetNamespace="urn:Remedy +Method"> <xsd:element name="OpGet" type="s0:GetInputMap"/> <xsd:complexType name="GetInputMap"> <xsd:sequence> <xsd:element name="Request_ID" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="OpGetResponse" type="s0:GetOutputMap"/> <xsd:complexType name="GetOutputMap"> <xsd:sequence> <xsd:element name="Assigned_To" type="xsd:string"/> <xsd:element name="assigned_group" type="xsd:string"/> <xsd:element name="Create_Date" type="xsd:dateTime"/> <xsd:element name="Last_Modified_By" type="xsd:string"/> <xsd:element name="Modified_Date" type="xsd:dateTime"/> <xsd:element name="rem_alertgroup" type="xsd:string"/> <xsd:element name="rem_alertkey" type="xsd:string"/> <xsd:element name="rem_customer" type="xsd:string"/> <xsd:element name="rem_ipcname" type="xsd:string"/> <xsd:element name="rem_ipcstatus" type="xsd:string"/> <xsd:element name="rem_location" type="xsd:string"/> <xsd:element name="rem_node" type="xsd:string"/> <xsd:element name="rem_nodealias" type="xsd:string"/> <xsd:element name="rem_region" type="xsd:string"/> <xsd:element name="rem_severity" type="xsd:int"/> <xsd:element name="rem_summary" type="xsd:string"/> <xsd:element name="Request_ID" type="xsd:string"/> <xsd:element name="Short_Description" type="xsd:string"/> <xsd:element name="Status" type="s0:StatusType"/> <xsd:element name="Status_History" type="xsd:string"/> <xsd:element name="Submitter" type="xsd:string"/> <xsd:element name="ucn" type="xsd:string"/> <xsd:element name="zassignedgroupid" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:simpleType name="StatusType"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="unprocessed"/> <xsd:enumeration value="processed"/> </xsd:restriction> </xsd:simpleType> <xsd:element name="OpService" type="s0:ServiceInputMap"/> <xsd:complexType name="ServiceInputMap"> <xsd:sequence> <xsd:element name="Assigned_To" type="xsd:string"/> <xsd:element name="assigned_group" type="xsd:string"/> <xsd:element name="rem_alertgroup" type="xsd:string"/> <xsd:element name="rem_alertkey" type="xsd:string"/> <xsd:element name="rem_customer" type="xsd:string"/> <xsd:element name="rem_ipcname" type="xsd:string"/> <xsd:element name="rem_ipcstatus" type="xsd:string"/> <xsd:element name="rem_location" type="xsd:string"/> <xsd:element name="rem_node" type="xsd:string"/> <xsd:element name="rem_nodealias" type="xsd:string"/> <xsd:element name="rem_region" type="xsd:string"/> <xsd:element name="rem_severity" type="xsd:int"/> <xsd:element name="rem_summary" type="xsd:string"/> <xsd:element name="Short_Description" type="xsd:string"/> <xsd:element name="Status" type="s0:StatusType"/> <xsd:element name="Submitter" type="xsd:string"/> <xsd:element name="ucn" type="xsd:string"/> <xsd:element name="zassignedgroupid" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="OpServiceResponse" type="s0:ServiceOutputMap"/> <xsd:complexType name="ServiceOutputMap"> <xsd:sequence> <xsd:element name="Assigned_To" type="xsd:string"/> <xsd:element name="assigned_group" type="xsd:string"/> <xsd:element name="Create_Date" type="xsd:dateTime"/> <xsd:element name="Last_Modified_By" type="xsd:string"/> <xsd:element name="Modified_Date" type="xsd:dateTime"/> <xsd:element name="rem_alertgroup" type="xsd:string"/> <xsd:element name="rem_alertkey" type="xsd:string"/> <xsd:element name="rem_customer" type="xsd:string"/> <xsd:element name="rem_ipcname" type="xsd:string"/> <xsd:element name="rem_ipcstatus" type="xsd:string"/> <xsd:element name="rem_location" type="xsd:string"/> <xsd:element name="rem_node" type="xsd:string"/> <xsd:element name="rem_nodealias" type="xsd:string"/> <xsd:element name="rem_region" type="xsd:string"/> <xsd:element name="rem_severity" type="xsd:int"/> <xsd:element name="rem_summary" type="xsd:string"/> <xsd:element name="Request_ID" type="xsd:string"/> <xsd:element name="Short_Description" type="xsd:string"/> <xsd:element name="Status" type="s0:StatusType"/> <xsd:element name="Status_History" type="xsd:string"/> <xsd:element name="Submitter" type="xsd:string"/> <xsd:element name="ucn" type="xsd:string"/> <xsd:element name="zassignedgroupid" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="OpCreate" type="s0:CreateInputMap"/> <xsd:complexType name="CreateInputMap"> <xsd:sequence> <xsd:element name="Assigned_To" type="xsd:string"/> <xsd:element name="assigned_group" type="xsd:string"/> <xsd:element name="rem_alertgroup" type="xsd:string"/> <xsd:element name="rem_alertkey" type="xsd:string"/> <xsd:element name="rem_customer" type="xsd:string"/> <xsd:element name="rem_ipcname" type="xsd:string"/> <xsd:element name="rem_ipcstatus" type="xsd:string"/> <xsd:element name="rem_location" type="xsd:string"/> <xsd:element name="rem_node" type="xsd:string"/> <xsd:element name="rem_nodealias" type="xsd:string"/> <xsd:element name="rem_region" type="xsd:string"/> <xsd:element name="rem_severity" type="xsd:int"/> <xsd:element name="rem_summary" type="xsd:string"/> <xsd:element name="Short_Description" type="xsd:string"/> <xsd:element name="Status" type="s0:StatusType"/> <xsd:element name="Submitter" type="xsd:string"/> <xsd:element name="ucn" type="xsd:string"/> <xsd:element name="zassignedgroupid" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="OpCreateResponse" type="s0:CreateOutputMap"/> <xsd:complexType name="CreateOutputMap"> <xsd:sequence> <xsd:element name="Request_ID" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="OpGetList" type="s0:GetListInputMap"/> <xsd:complexType name="GetListInputMap"> <xsd:sequence> <xsd:element name="Qualification" type="xsd:string"/> <xsd:element name="startRecord" type="xsd:string"/> <xsd:element name="maxLimit" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="OpGetListResponse" type="s0:GetListOutputMap"/> <xsd:complexType name="GetListOutputMap"> <xsd:sequence> <xsd:element maxOccurs="unbounded" name="getListValues"> <xsd:complexType> <xsd:sequence> <xsd:element name="Assigned_To" type="xsd:string"/> <xsd:element name="assigned_group" type="xsd:string"/> <xsd:element name="Create_Date" type="xsd:dateTime"/> <xsd:element name="Last_Modified_By" type="xsd:string"/> <xsd:element name="Modified_Date" type="xsd:dateTime"/> <xsd:element name="rem_alertgroup" type="xsd:string"/> <xsd:element name="rem_alertkey" type="xsd:string"/> <xsd:element name="rem_customer" type="xsd:string"/> <xsd:element name="rem_ipcname" type="xsd:string"/> <xsd:element name="rem_ipcstatus" type="xsd:string"/> <xsd:element name="rem_location" type="xsd:string"/> <xsd:element name="rem_node" type="xsd:string"/> <xsd:element name="rem_nodealias" type="xsd:string"/> <xsd:element name="rem_region" type="xsd:string"/> <xsd:element name="rem_severity" type="xsd:int"/> <xsd:element name="rem_summary" type="xsd:string"/> <xsd:element name="Request_ID" type="xsd:string"/> <xsd:element name="Short_Description" type="xsd:string"/> <xsd:element name="Status" type="s0:StatusType"/> <xsd:element name="Status_History" type="xsd:string"/> <xsd:element name="Submitter" type="xsd:string"/> <xsd:element name="ucn" type="xsd:string"/> <xsd:element name="zassignedgroupid" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:element name="OpSet" type="s0:SetInputMap"/> <xsd:complexType name="SetInputMap"> <xsd:sequence> <xsd:element name="Assigned_To" type="xsd:string"/> <xsd:element name="assigned_group" type="xsd:string"/> <xsd:element name="rem_alertgroup" type="xsd:string"/> <xsd:element name="rem_alertkey" type="xsd:string"/> <xsd:element name="rem_customer" type="xsd:string"/> <xsd:element name="rem_ipcname" type="xsd:string"/> <xsd:element name="rem_ipcstatus" type="xsd:string"/> <xsd:element name="rem_location" type="xsd:string"/> <xsd:element name="rem_node" type="xsd:string"/> <xsd:element name="rem_nodealias" type="xsd:string"/> <xsd:element name="rem_region" type="xsd:string"/> <xsd:element name="rem_severity" type="xsd:int"/> <xsd:element name="rem_summary" type="xsd:string"/> <xsd:element name="Short_Description" type="xsd:string"/> <xsd:element name="Status" type="s0:StatusType"/> <xsd:element name="Submitter" type="xsd:string"/> <xsd:element name="ucn" type="xsd:string"/> <xsd:element name="zassignedgroupid" type="xsd:string"/> <xsd:element name="Request_ID" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="OpSetResponse" type="s0:SetOutputMap"/> <xsd:complexType name="SetOutputMap"> <xsd:sequence/> </xsd:complexType> <xsd:element name="AuthenticationInfo" type="s0:AuthenticationInfo"/> <xsd:complexType name="AuthenticationInfo"> <xsd:sequence> <xsd:element name="userName" type="xsd:string"/> <xsd:element name="password" type="xsd:string"/> <xsd:element minOccurs="0" name="authentication" type="xsd:string"/> <xsd:element minOccurs="0" name="locale" type="xsd:string"/> <xsd:element minOccurs="0" name="timeZone" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> </wsdl:types> <wsdl:message name="OpCreateSoapOut"> <wsdl:part element="s0:OpCreateResponse" name="parameters"/> </wsdl:message> <wsdl:message name="ARAuthenticate"> <wsdl:part element="s0:AuthenticationInfo" name="parameters"/> </wsdl:message> <wsdl:message name="OpServiceSoapOut"> <wsdl:part element="s0:OpServiceResponse" name="parameters"/> </wsdl:message> <wsdl:message name="OpSetSoapOut"> <wsdl:part element="s0:OpSetResponse" name="parameters"/> </wsdl:message> <wsdl:message name="OpCreateSoapIn"> <wsdl:part element="s0:OpCreate" name="parameters"/> </wsdl:message> <wsdl:message name="OpGetSoapOut"> <wsdl:part element="s0:OpGetResponse" name="parameters"/> </wsdl:message> <wsdl:message name="OpServiceSoapIn"> <wsdl:part element="s0:OpService" name="parameters"/> </wsdl:message> <wsdl:message name="OpGetListSoapOut"> <wsdl:part element="s0:OpGetListResponse" name="parameters"/> </wsdl:message> <wsdl:message name="OpGetSoapIn"> <wsdl:part element="s0:OpGet" name="parameters"/> </wsdl:message> <wsdl:message name="OpGetListSoapIn"> <wsdl:part element="s0:OpGetList" name="parameters"/> </wsdl:message> <wsdl:message name="OpSetSoapIn"> <wsdl:part element="s0:OpSet" name="parameters"/> </wsdl:message> <wsdl:portType name="PortPortType"> <wsdl:operation name="OpGet"> <wsdl:input message="s0:OpGetSoapIn"/> <wsdl:output message="s0:OpGetSoapOut"/> </wsdl:operation> <wsdl:operation name="OpService"> <wsdl:input message="s0:OpServiceSoapIn"/> <wsdl:output message="s0:OpServiceSoapOut"/> </wsdl:operation> <wsdl:operation name="OpCreate"> <wsdl:input message="s0:OpCreateSoapIn"/> <wsdl:output message="s0:OpCreateSoapOut"/> </wsdl:operation> <wsdl:operation name="OpGetList"> <wsdl:input message="s0:OpGetListSoapIn"/> <wsdl:output message="s0:OpGetListSoapOut"/> </wsdl:operation> <wsdl:operation name="OpSet"> <wsdl:input message="s0:OpSetSoapIn"/> <wsdl:output message="s0:OpSetSoapOut"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="PortSoapBinding" type="s0:PortPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/s +oap/http"/> <wsdl:operation name="OpGet"> <soap:operation soapAction="urn:RemedyMethod/OpGet" style="document"/> <wsdl:input> <soap:header message="s0:ARAuthenticate" part="parameters" use="litera +l"> </soap:header> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="OpService"> <soap:operation soapAction="urn:RemedyMethod/OpService" style="documen +t"/> <wsdl:input> <soap:header message="s0:ARAuthenticate" part="parameters" use="litera +l"> </soap:header> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="OpCreate"> <soap:operation soapAction="urn:RemedyMethod/OpCreate" style="document +"/> <wsdl:input> <soap:header message="s0:ARAuthenticate" part="parameters" use="litera +l"> </soap:header> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="OpGetList"> <soap:operation soapAction="urn:RemedyMethod/OpGetList" style="documen +t"/> <wsdl:input> <soap:header message="s0:ARAuthenticate" part="parameters" use="litera +l"> </soap:header> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="OpSet"> <soap:operation soapAction="urn:RemedyMethod/OpSet" style="document"/> <wsdl:input> <soap:header message="s0:ARAuthenticate" part="parameters" use="litera +l"> </soap:header> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="RemedyMethodService"> <wsdl:port binding="s0:PortSoapBinding" name="PortSoap"> <soap:address location="http://SERVER/arsys/services/ARService?server= +devsupport&webService=RemedyMethod"/> </wsdl:port> </wsdl:service> </wsdl:definitions> </readmore>

Replies are listed 'Best First'.
Re: Exposing Soap Errors
by locked_user sundialsvc4 (Abbot) on Mar 23, 2011 at 16:08 UTC

    Puh-leeuze edit this post to use “readmore” tags so that those who do not want to encounter the entire text do not have to.   Thanks.

      Thanks for the heads up ... corrected. ;-)
Re: Exposing Soap Errors
by dneedles (Sexton) on Mar 23, 2011 at 18:33 UTC
    After a bit of digging I found this is the wrong approach. Soap::Lite doesn't really handle accessing the wsdl directly. Instead using stubmaker.pl and accessing the methods along the lines of http://cookbook.soaplite.com/#making soap works much better.