cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Fault Responses in a synchronous SOAP interface in PI 7.11

Former Member
0 Kudos

Hi experts,

I do not find too much about handling of SOAP Faults in SAP PI and I do not understand the implementation of that in PI.

I have a following situation:

I’m using already prepared web service, that handle SOAP messages and in some cases this web service returns Fault responses containing business error codes. For example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <soapenv:Body>

      <soapenv:Fault>

<faultcode>soapenv:Server.userException</faultcode>

         <faultstring>ERROR (380)</faultstring>

         <detail>

            <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">*******</ns1:hostname>

         </detail>

      </soapenv:Fault>

   </soapenv:Body>

</soapenv:Envelope>

The problem is, that in PI Fault payload I see only <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">*******</ns1:hostname>.

The real error code is in <faultstring>ERROR (380)</faultstring>, but I have no access to it. It looks like that SOAP adapter takes all SOAP 1.1 default elements and swallow them.

How can I access all these elements to be able to map them back?

Thank in advance for your answers,

Ianko

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Ianko,

Check the below links and see if it helps(Try the mapping as per the links)

Former Member
0 Kudos

Hi Raghuraman,

I know the first link from Jin Shin. What is he describing there is reflected at my side too.

As a Fault he creates an independent message type. This mesage type is sended in the <detail> element of a standard SOAP 1.1 Fault type. The question is how to get the standard elements.: <faultstring>

The second link shows the Fault still packed in a "SoapEnvelop". This was described as a wrong behavior.

If the answer is: "no way to get them using the SOAP adapter", then I must accept it and look for other ways. The other way - to switch to HTTP adapter means to simulate SOAP manually is not exactly the preferred way.

Regards,

Ianko

former_member186851
Active Contributor
0 Kudos

Hello Lanko,

you can map the elements in the enevelope right,By getting the fault WSDL from the third party.

But am not 100% Sure how it will work

engswee
Active Contributor
0 Kudos

Hi Ianko

This behavior of the SOAP adapter is described in the following SAP note - Question 7 - What should my web service return to the adapter.

856597 - FAQ: XI 3.0 / PI 7.0/7.1/7.3 SOAP Adapter

From the example there, only the elements under the <detail> node are returned as an application error message. As such, the <faultcode> and <faultstring> are not available, and you might have to go for other approaches - i.e. manually parse the whole fault response.

Regards

Eng Swee

Former Member
0 Kudos

Thank you Eng,

this note gives me the ultimate answer to my question: I must go another way and the last link sent by Raghuraman shows it.

I would give to both of your the the mark "correct answer", Will it work? I will test it

Regards,

Ianko

engswee
Active Contributor
0 Kudos

Hi Ianko

It is only possible to mark one reply as the correct answer, and multiple replies as helpful answer. Which one is correct is up to your prerogative.

Regards

Eng Swee

former_member186851
Active Contributor
0 Kudos

Hello Lanko,

As Engg suggested you can give the best answer as correct and rest as Helpful answers..:)

Glad that you got a solution .:)

Former Member
0 Kudos

Hi Raghuraman,

you answer shows me the way to get this "technical" element, which actually contains business answer, in the payload and to use it. This was my question.

The answer from Eng is very helpful because otherwise the other in the team do not believe me when I tell them that PI normally doesn't show such elements

Thank you both,

Ianko

Answers (0)