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

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

Expand Messages
  • Oeschey, Lars (I/ET-83, extern)
    Sep 30, 2008
    • 0 Attachment
      > You will find that the "500 Internal Server Error" is returned for
      > many cases where there is a problem on the server side like missing
      > parameters or restrictive file permissions. The 500 error is what I
      > would expect for the situation you describe.
      > It would be nice to get something more descriptive from SOAP.
      > However, the error condition you describe is not a problem with SOAP
      > (transport), but a problem with the service/subroutine itself. If
      > you have access to the parameter list on the server side before it's
      > (automatically?) parsed, you should be able to check that list and
      > return your own SOAP error code and string if parameters are missing
      > or invalid.

      hm, I asked the company that is responsible for the server side of the
      SOAP I use. They told me they send a faultcode etc., it looks like this:

      HTTP/1.1 500 Internal Server Error
      Connection: close
      Content-Type: text/xml; charset=utf-8
      Content-Length: 561
      Server: Indy/9.0.18
      <?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:Fault>
      <soap:faultcode>soap:Server</soap:faultcode>
      <soap:faultstring>
      IdSoapRpcXml.TIdSoapReaderXML.GetParameter: Parameter
      "in2" not found in list ""
      </soap:faultstring>
      <detail xsi:type="EIdSoapRequirementFail"></detail>
      </soap:Fault>
      </soap:Body>
      </soap:Envelope>

      However with your example code

      use SOAP::Lite;
      $soap= SOAP::Lite
      ->uri('http://soap.data.inform.com')
      ->proxy('http://soapserver.tld:3003/soap/');

      eval {$soapReply = $soap->teInput("lala,lulu");};
      if ($@) {
      chomp ($@);
      print "Server Error ->" . $@ . "<-...skipping";
      }
      elsif ($soapReply->fault) {
      print "Fault code from function ->" .
      $soapReply->faultcode . "<-";
      print "Fault string from function ->" .
      $soapReply->faultstring . "<-...skipping";
      }
      else {
      print $soapReply;
      }

      I get nothing more than the 500 Server error. I think I should also get
      the soap->faultcode etc., something must be still wrong on my side
      then...
    • Show all 15 messages in this topic