Loading ...
Sorry, an error occurred while loading the content.

6245RE: [soaplite] Re: How to get errors

Expand Messages
  • Oeschey, Lars (I/ET-83, extern)
    Oct 6, 2008
    • 0 Attachment
      > First don't input raw values to teInput function. Follow your service
      > description.
      > Something like this:
      >
      > my $som=$soap->teInput(
      > SOAP::Data->name(in0 =>
      > 'MAN9999999/1'),
      > SOAP::Data->name(in1 =>
      > 'LAD1020'),
      > SOAP::Data->name(in2 =>
      > 1)->type('string'),

      This works good for the positive case (i.e. all values are good). If I
      want to get an error, by sending the last value as string, I should get
      an error from $som->fault however. I only get a http 500 error. The
      trace contains the fault though:

      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/s
      oap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.
      xmlsoap.org/soap/envelope/"><soap:Body><teInput
      xmlns="http://soap.data.inform.com"><in0
      xsi:type="xsd:string">MAN9999999/1</in0><in1 xsi:type="xsd:st
      ring">LAD22010</in1><in2
      xsi:type="xsd:int">1</in2></teInput></soap:Body></soap:Envelope>
      SOAP::Transport::HTTP::Client::send_receive:
      HTTP::Response=HASH(0x1e38270)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
      Server Error
      Cache-Control: proxy-revalidate
      Connection: close
      Date: Mon, 06 Oct 2008 13:44:41 GMT
      Server: Indy/9.0.18
      Content-Length: 689
      Content-Type: text/xml; charset=utf-8
      Client-Date: Mon, 06 Oct 2008 13:44:40 GMT
      Client-Peer: 10.250.52.241:8080
      Client-Response-Num: 1

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xs="http://www.
      w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><soap:F
      ault><soap:faultcode>soap:Server</soap:faultcode><soap:
      faultstring>Type Mismatch. For the parameter in2, the type found was
      "int" in the namespace
      "http://www.w3.org/2001/XMLSchema", which
      doesn't match any of the expected values:
      {http://www.w3.org/2001/XMLSchema}string</soap:faultstring><detail
      xsi:type="EIdSoapRequirementFail"></d
      etail></soap:Fault></soap:Body></soap:Envelope>

      I'm trying to get the fault like this:

      if ($som->fault) {
      print $som->faultdetail; # returns value of 'detail' element as
      # string or object
      print $som->faultcode; #
      print $som->faultstring; # also available
      print $som->faultactor; #
      }
      else {print "result:$som\n";}
    • Show all 15 messages in this topic