Skip to Content

XI: Propagation of meaningful error information to SOAP Client

1. Introduction

A common problem with any Integration solution is in providing proper error information to the call initiater when hit with failures. These failures could be due any of the reasons like back end system avialability, network errors, auhorization failures, data inconsistency , database specific errors, mapping failures etc. With XML Webservices forming the backbone of any SOA based landscape, propagating meangful error information to the calling client is essential. This weblog will present the importance of defining Fault Messages and different ways of handlying exceptions. This weblog is aimed in armoring a XI developer with execpton handling design patern that he/she could propose to the application developer. Sample code in Java , C# , VB will also be provided for handling exceptions.

2. Scenario

To better understand the problem at hand, let us assume there is an Enterprise Webservice reqestCustomerDetails which gets custmer information based on various request paramters. You have finished development in Integration Repository and have configured the scenario in Configuration Directory. The wsdl for the scenaro is generated and communicated back to the application developer. Let us assume the consuming application is a .net application in our example. The developer generates proxies from the wsdl, codes the logic of calling the webservice in the application for getting customer informaion.

3. Issue

During application testing the call to webservice fails. This could be due any number of reasons, most common errors are listed bellow.

1. Wrong Communication Channel/Party/Service

2. Missing Reciever Determination

3. Missing Sender Agreement

4. Missing back end Authorizations for the service userid.

But for all the above errors the calling application gets an Exception

“Server Error”

with no inidcation as to what the actual error was. Some of these can be easily traced by the XI developer in SXMB_MONI or RWB. But CPACache and back end authorizations errors would take a substantial digging for resoultion. In most of the cases XI developer gets a call saying a particular interface failed, what would be more useful for getting the turn around time of issue fixing would be some error specific information like <b>”No authorizaton for RFC group XXX”</b>.

You must be Logged on to comment or reply to a post.
    • Hi Sravya,

      Unfortunaley there is no one site that provides you all the information.  I have started writing on a best practices series for webservices. I am trying  to put in the things that really matter the most when consuming or exposing a webservice.


  • Hi Naveen,
    I have some questions regarding the SOAP Fault message and am sure you are the right guy who can answer this.

    1. In the article you say "To complete the design make sure to do appropiate message mapping of the fault message". Consider two scenarios (synchronous)

    a. XI exposed webservice(Outbound Interface) <--> XI <--> RFC adapter --(Inbound interface) Remote enablef function.M.(SAP)

    b. XI exposed webservice(Outbound Interface) <--> XI <-> XI Proxy adapter --(Inbound interface)SAP

    Can we do the SOAP fault messaging in the scenario a ? since we cannot define a SOAP fault message in the inbound interface.
    For the scenario b, I feel it can be done since we can define the Fault message at both the O/B & inbound interfaces ? correct me if i am wrong.

    Regarding capturing the errors (below) do we need to write custom java functions in the message mapping tool?

    1. Wrong Communication Channel/Party/Service
    2. Missing Reciever Determination
    3. Missing Sender Agreement
    4. Missing back end Authorizations for the service userid.

    2. This is a general question regarding the XI exposed webservices. In the standard webservices there will be no. of actions (methods). for e.g. in a calcultor webservice there will be ADD, SUB, MULTIPLY etc.. all embedded in the WSDL. But in the XI exposed webservices can we do this? since we have to generate WSDL for each message interface.

    Hope you will explain SOAP fault exception in detail in one of your weblogs in the SOAP best practices series ....

    Thanks a lot for sharing information about XI webservices .



    • Hi Mathew,

      You have asked very good questions. And i was planning on addressing each of those issue in detail in the webservice series. To put thins in short
      >>Can we do the SOAP fault messaging in the >>scenario a
      yes we can, if the RFC has a defined exception as simple as Application Exception, when you import the rfc into xi, it generated rtc.exeception. you can use this for mapping with FaultMessage.

      >>Regarding capturing the errors (below) do we >>need to write custom java functions in the >>message mapping tool?
      no you dont need to do any custom development, when such an error occurs, XI will catch the error and send back to the caller as a soap execption, taht is the power of SOAP Fault message.

      >>2. This is a general question regarding the XI >>exposed webservices.
      this is an excelent question. IN xi you can only have single soap action unlike in the webservices provided by .NET and J2EE implementations. I will present this design catch 22 problem in the weblog.


      • Hi Naveen,
                  Thanks for the reply. I am clear except the SOAP fault message mapping. If I have fault message types associated w/ an outbound & an inbound interface I can map it. But still, how it can catch exceptions that occur in XI runtime?. W/ out using a fault message itself, SOAP adapter is generating SOAP fault message, but some what generic(Tested w/ altova XML spy). Will the default fault elements provided in the Fault message catch exceptions? I didn't able to find much good documentation on Fault message handling.

        Thanks & Regards,

      • Hi Naveen,
        Thanks for this information. I am having problem in capturing the SOAP response in my scenario.  SAP--> XI --> Webservice). I am using Asyn Inbound Interface and SOAP Adapter on receiver side to call the webserive. I am not able to get the actual SOAP response in the Message monitoring if any application error occours. I could see the actual response on XML Spy but in XI its logging as unkown application error. I have used Fault message also but still could not get it. Do we need to use the fault message with same structure as the response or we can use the standard structure. I have used the std structure and with attachment of the actual response structure.

        Please let me know what is going wrong.


  • Naveen,

    Good job, an interesting blog !!

    I've a o/b synch MI which is exposed as a web service. I specified the fault message with faultcode, faultstring, faultactor and detail. I've a BPM as the receiver for this synch infterface. This BPM implements synch-asynch bridge.

    Now the question is...How can I specify that a particular fault message needs to be returned to the SOAP caller? I can send the response for the SOAP caller using the send step with mode 'Closes S/A bridge'. But, which step should I use to return the fault message?

    Any ideaz?

    thx in adv

    PS: I posted the same query on the forum, but no replies so far. I thought you are the right person to answer this question.