Hi, consider the following code snippet:
$s=SOAP::Lite ->service('http://preview.etracker.de:8008/wsAPI?wsdl') ->on_fault(sub { my($soap, $res) = @_; ... }); eval { ... $s->setFilter($ticket, $stat_id, '^-[^,]+,4853,', FILTER_TYPE_REGEXP); ... };
according to the docs $res in the fault handler is an SOAP::SOM object. But in my case I get a string, see below.

The source reveals that this happens when the response from a server cannot be deserialized. The deserialization died with "Unspecified namespace for type \'Struct[6]\'".

But why?

What is wrong? Is it the service description or the fault response?

'Unspecified namespace for type \'Struct[6]\' <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/en +velope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:wsAPI" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode xsi:type="xsd:QName">SOAP-ENV:Client</faultcode> <faultstring xsi:type="xsd:string">soap request contained incorrect nu +mber of parameters. method \'setFilter\' required 3 and request provided 4</faultstring> <faultactor xsi:type="xsd:anyURI"></faultactor> <detail xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Struct[6]" SOAP-ENC:offset="[0]"> <item> <file xsi:type="xsd:string">/home/web/etracker.de/web/inc/pear/SOAP/Fault.ph +p</file> <line xsi:type="xsd:int">49</line> <function xsi:type="xsd:string">pear_error</function> <class xsi:type="xsd:string">pear_error</class> <type xsi:type="xsd:string">::</type> <args xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:anyType[5]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">soap request contained incorrect number of + parameters. method \'setFilter\' required 3 and request provided 4</it +em> <item xsi:type="xsd:string">Client</item> <item/> <item/> <item xsi:type="xsd:string"></item></args></item> <item> <file xsi:type="xsd:string">/home/web/etracker.de/web/inc/pear/SOAP/Base.php +</file> <line xsi:type="xsd:int">199</line> <function xsi:type="xsd:string">soap_fault</function> <class xsi:type="xsd:string">soap_fault</class> <type xsi:type="xsd:string">-&gt;</type> <args xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:anyType[6]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">soap request contained incorrect number of + parameters. method \'setFilter\' required 3 and request provided 4</it +em> <item xsi:type="xsd:string">Client</item> <item xsi:type="xsd:string"></item> <item xsi:type="xsd:string"></item> <item/> <item/></args></item> <item> <file xsi:type="xsd:string">/home/web/etracker.de/web/inc/pear/SOAP/Server.p +hp</file> <line xsi:type="xsd:int">532</line> <function xsi:type="xsd:string">_raisesoapfault</function> <class xsi:type="xsd:string">soap_server</class> <type xsi:type="xsd:string">-&gt;</type> <args xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[4]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">soap request contained incorrect number of + parameters. method \'setFilter\' required 3 and request provided 4</it +em> <item xsi:type="xsd:string"></item> <item xsi:type="xsd:string"></item> <item xsi:type="xsd:string">Client</item></args></item> <item> <file xsi:type="xsd:string">/home/web/etracker.de/web/inc/pear/SOAP/Server.p +hp</file> <line xsi:type="xsd:int">398</line> <function xsi:type="xsd:string">verifymethod</function> <class xsi:type="xsd:string">soap_server</class> <type xsi:type="xsd:string">-&gt;</type> <args xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="Struct[1]" SOAP-ENC:offset="[0]"> <ns4:setFilter> <ns4:ticket xsi:type="xsd:string">d60d0fb960c5bd28c4fa54bcfc4ed05a</ns4:ticket> <ns4:stat_id xsi:type="xsd:string">StatisticUsagePageImpressions</ns4: +stat_id> <ns4:filter xsi:type="xsd:string">^-[^,]+,4853,</ns4:filter> <ns4:c-gensym22 xsi:type="xsd:int">4</ns4:c-gensym22></ns4:setFilter></args></item> <item> <file xsi:type="xsd:string">/home/web/etracker.de/web/inc/pear/SOAP/Server.p +hp</file> <line xsi:type="xsd:int">170</line> <function xsi:type="xsd:string">parserequest</function> <class xsi:type="xsd:string">soap_server</class> <type xsi:type="xsd:string">-&gt;</type> <args xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:anyType[2]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;soap:Envelope xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:tns=&quot;urn:wsAPI&quot; soap:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quo +t; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&l +t;soap:Body&gt;&lt;tns:setFilter&gt;&lt;ticket xsi:type=&quot;xsd:string&quot;&gt;d60d0fb960c5bd28c4fa54bcfc4ed05a&lt +;/ticket&gt;&lt;stat_id xsi:type=&quot;xsd:string&quot;&gt;StatisticUsagePageImpressions&lt;/s +tat_id&gt;&lt;filter xsi:type=&quot;xsd:string&quot;&gt;^-[^,]+,4853,&lt;/filter&gt;&lt;c-g +ensym22 xsi:type=&quot;xsd:int&quot;&gt;4&lt;/c-gensym22&gt;&lt;/tns:setFilter +&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</item> <item xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:anyType[0]"/></args></item> <item> <file xsi:type="xsd:string">/home/web/etracker.de/web/wsAPI.php</file> <line xsi:type="xsd:int">61</line> <function xsi:type="xsd:string">service</function> <class xsi:type="xsd:string">soap_server</class> <type xsi:type="xsd:string">-&gt;</type> <args xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;soap:Envelope xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:tns=&quot;urn:wsAPI&quot; soap:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quo +t; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&l +t;soap:Body&gt;&lt;tns:setFilter&gt;&lt;ticket xsi:type=&quot;xsd:string&quot;&gt;d60d0fb960c5bd28c4fa54bcfc4ed05a&lt +;/ticket&gt;&lt;stat_id xsi:type=&quot;xsd:string&quot;&gt;StatisticUsagePageImpressions&lt;/s +tat_id&gt;&lt;filter xsi:type=&quot;xsd:string&quot;&gt;^-[^,]+,4853,&lt;/filter&gt;&lt;c-g +ensym22 xsi:type=&quot;xsd:int&quot;&gt;4&lt;/c-gensym22&gt;&lt;/tns:setFilter +&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</item></args></item></de +tail></SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ';

In reply to SOAP::Lite error handling by tfoertsch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.