on 04-25-2016 2:08 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.