Re: undefined response in case of fault

Igor Korolev <[email protected]> Fri, 27 Jun 2003 14:38:07 -0500
Newsgroups gmane.comp.windows.devel.soap.general
Message-ID <F33BD4B0C42B8C4684C24DD28BD4136501053E58@nte2k04.mpls.digitalriver.com>
Hello,

Could somebody please tell me if there are methods for getting fault
text received in SOAP body of a response using SOAP::Lite ?

For some reason, SOAP::Lite::call will not return anything if HTTP
response code is not 200 while current SOAP standard
http://www.w3.org/TR/2003/REC-soap12-part0-20030624/
says that

If an error occurs processing the request, the HTTP binding
specification requires that a HTTP 500 "Internal Server Error" be used
with an embedded SOAP message containing a SOAP fault indicating the
server-side processing error.
Example 11 is the same SOAP fault message as Example 6a, but this time
with the HTTP headers added.

Example 11 
HTTP/1.1 500 Internal Server Error
Content-Type: application/soap+xml; charset="utf-8"
Content-Length: nnnn

<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Body>
    <env:Fault>
     <env:Code>
       <env:Value>env:Sender</env:Value>
       <env:Subcode>
        <env:Value>rpc:BadArguments</env:Value>
       </env:Subcode>
     </env:Code>
     <env:Reason>
      <env:Text xml:lang="en-US">Processing error</env:Text>
      <env:Text xml:lang="cs">Chyba zpracovani</env:Text>
     </env:Reason>
     <env:Detail>
      <e:myFaultDetails 
        xmlns:e="http://travelcompany.example.org/faults" >
        <e:message>Name does not match card number</e:message>
        <e:errorcode>999</e:errorcode>
      </e:myFaultDetails>
     </env:Detail>
   </env:Fault>
 </env:Body>
</env:Envelope>

Thank you,

 Igor Korolev
 
 Digital River Inc.
 9625 West 76th Street, Suite 150 
 Eden Prairie, MN 55344
 Tel:  (952) 253-8411
 Fax: (952) 253-8497
 [email protected]