Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Handling of SOAP Faults in SOAP Clients consuming PI Web services

Hi there,

the following is in regards to SOAP fault error handling in a SOAP client that consumes a Web Service published by PI.

I have been reading a number of threads and blogs in regards to this topic and I am still left with some open questions which I hope to get some final answersclarifications through this thread.

In particular the blogs

Handling Web Service SOAP Fault Responses in SAP NetWeaver XI - Handling Web Service SOAP Fault Responses in SAP NetWeaver XI

XI: Propagation of meaningful error information to SOAP Client - XI: Propagation of meaningful error information to SOAP Client

have caused by attention.

Both of these threads are realating to the Fault Message type one can use to return errors back to a SOAP Client (.Net, Java, etc.).

In our scenario we published a number of Web Services through PI that provide functionality to integrate with an R3 back-end system using inbound ABAP Proxies.

The services are standardised and will be consumed by a number of .NetJava applications and systems. The reason for the use of ABAP proxies is the customer specific application logic that is executed in the backend system. The Web services are synchronous and don't use ccBPM in the middle. Transformations are performed in PI combined with various lookups to set default values before the message is passed into the ABAP Framework of the R3 back-end system. The lookups are done against the R3 back-end system using the PI RFC Lookup feature.

The inbound proxies currently return application errors as part of the response message back to the SOAP client. For more critical errors we introduced the use of Fault message types as the method to return the information back to the SOAP Client. This is all working satisfactory.

The questions I have are as follows.

1. When an error occurs at the IE level (e.g. mapping error), ABAP Proxy framework level (e.g. conversion from XML to ABAP format) or Adapter Framework level (Adapter releated error) a different SOAP fault message structure is returned to the SOAP Client than the one used for the application errors. The SOAP fault message structure used in this case is the standard SOAP fault used by PI to return system errors back to the caller. For those SOAP fault messages there is no payload generated that could be mapped to the SOAP fault structure used for the application errors. This would be preferrable as there would be only one Fault message structure used for both inbound ABAP proxy generated fault messages and PI generated fault messages.

Also the error messages generated by PI can be quite cryptic and difficult to interpret at the client end and could be filtered ranslated during message mapping if the payload of the PI generated SOAP fault message could be accessed in a message mapping.

Point 3 of the above thread 2759 indicates that this would be possible but doesn't outline how. Could somebody please clarify this for me as I don't believe that this is really possible ???.

My idea instead was to use the PI SOAP fault message structure to also return application errors. Therefore I would create a Fault message type that matches the PI SOAP fault structure. This would enable the SOAP Client to handle only one SOAP Fault error structure. Would that be something to look into instead ?????.

2. We have been looking at using the integrated WEB AS SOAP adapter instead of using the AF Sender SOAP adapter. While playing with this we encountered differences in the content returned through the SOAP fault generated by PI. A sample is below. Shouldn't the content of these SOAP faults be the same if the error that caused it is the same. Also the SOAP fault returned by the IE SOAP adapter is much more useful in this particular case. Both errors below are the same, a conversion error from XML to ABAP took place in the inbound ABAP proxy framework of the back-end system.

SOAP fault returned when using SOAP Sender adapter of AF

<!see the documentation>

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SOAP:Body>

<SOAP:Fault>

<faultcode>SOAP:Server</faultcode>

<faultstring>Server Error</faultstring>

<detail>

<s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">

<context>XIAdapter</context>

<code>ADAPTER.JAVA_EXCEPTION</code>

<text>com.sap.aii.af.ra.ms.api.DeliveryException: XIProxy:PARSE_APPLICATION_DATA:

at com.sap.aii.adapter.xi.ms.XIEventHandler.onTransmit(XIEventHandler.java:455)

at com.sap.aii.af.ra.ms.impl.core.queue.consumer.CallConsumer.onMessage(CallConsumer.java:134)

at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:916)

at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)</text>

</s:SystemError>

</detail>

</SOAP:Fault>

</SOAP:Body>

</SOAP:Envelope>

SOAP fault using integrated SOAP adapter of PI IE

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SOAP:Body>

<SOAP:Fault>

<faultcode>SOAP:Server</faultcode>

<faultstring>System Error</faultstring>

<detail>

<s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">

<context/>

<code>ABAP.PARSE_APPLICATION_DATA</code>

<text>Error during XML => ABAP conversion (Request Message; error ID: CX_ST_DESERIALIZATION_ERROR; (/1SAI/TXSBE20FF604BAFEF8D990A XML Bytepos.: 564 XML Path: ns1:CreatePORequest(1)POHEADER(2)COMP_CODE(1) Error Text: Data loss occurred when converting ############################## Kernel ErrorId: CONVT_DATA_LOSS))</text>

</s:SystemError>

</detail>

</SOAP:Fault>

</SOAP:Body>

</SOAP:Envelope>

I have been reading threads for hours without being able to find one that answers questions 1 or provides a blog that outlines the approach one should take for error handling in SOAP clients that consume PI Web Services (and covers both PISystem generated faults and faults raised in Proxies).

There may already be a blog or thread and I just missed it.

Any comments are welcome.

Thanks. Dieter

Former Member
Not what you were looking for? View more on this topic or Ask a question