Skip to Content
avatar image
Former Member

Handling standard SOAP fault in Proxy to SOAP synchronous scenario

Hi Gurus,

Hope you are doing well.

I have a synchronous Proxy to SOAP (Web Service) scenario in SAP PI 7.0 environment. Here we are consuming an external web service in PI. The web service is a standard one and consists of a number of methods for handling different functions such as create, query, update and delete. I have defined request structures for sending requests using corresponding methods defined in the external web service and the same are working fine. I have also defined response structures for receiving responses using corresponding methods defined in the the external web service and the same are also working fine. The problem is the external web service does not have any method defined for sending fault messages. The fault message being returned is a standard SOAP fault having the following structure. Since there is no method defined in the external web service, the SOAP message returned back is not getting caught in PI and is being treated as a system error.

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:f="http://www.w3.org/2001/12/soap-faults">
<env:Body>
  <env:Fault>
  <faultcode>env:Sender</faultcode>
  <faultstring>XXXXXXXX</faultstring>
  <detail>
  <Error>
    <Code>XX</Code>
    <Description>XXXXXXXXXX</Description>
    <Path>XXXXXXXX</Path>
  </Error>
  <Error>
  <Code>XX</Code>
    <Description>XXXXXXXXXX</Description>
    <Path>XXXXXXXX</Path>
  </Error>
  .....
  .....
  </detail>
  </env:Fault>
</env:Body>
</env:Envelope>

I tried defining a similar structure withion the external WSDL and mapping the same to XI fault structure but still the exception did not get caught. I also tried defining the above fault structure as part of the response but still the exception did not get caught.

Is there a way to catch the fault in PI? Please let me know. Points would be assigned to helpful answers.

regards
Debansu

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 28, 2013 at 02:48 AM

    Hi Debansu,

    A custom structure is only helpful if the protocol is maintained. Exception or Fault communication is not maintained in your web service (for Synchronous communication is should be there), so you if also try handle this by creating a custom structure, it will not help. Consult with the Receiver Web Service team and they will add this. Then you need to re upload the WSDL and perform required Fault Message mapping. Thats all. For WS team, this should not be a big task.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 28, 2013 at 06:01 AM

    Hi ,

    As above said ;fault  message at receiver should be added by web service folks in the wsdl and need to share the updated wsdl  to PI team.

    For each method in wsdl they will write corresponding back end logic ;when to populate what .

    For fault exception also follows the same.

    Example for your understanding.

    In a synchronous interface for address search(For post code returning complete address)

    If no address found in back end d/b of target system need to return "No address found for i/p postcode" as fault message ....etc.

    Regards

    Venkat

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Debansu,

      As far as i know there is no a "standard" way to deal the SOAP fault message. You could try to develop a java mapping that internally find out the exception cause, and try to construct a validable answer.

      May be, the best option is to work with the alert PI system and send an email if the error occurs. In the sender proxy you could treat the exception with a generic message. 

      Regards,