cancel
Showing results for 
Search instead for 
Did you mean: 

Handling of SOAP Faults in SOAP Clients consuming PI Web services

Former Member
0 Kudos

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

- 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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi there,

as there has been not very much input to this thread I will close it with my recommendations and learnings.

1. SOAP faults genereated by System errors in the Adapter engine, IE or Proxy Framework should be seen as system errors. These system errors are return to the consumer in the details section of the SOAP Fault. Access to this information through mapping is not possible using standard functionality in PI.

2. Application errors detected as part of BAPI processing can be returned to the consumer either through the repsone message type or fault message type. However to reduce the amount of coding one needs to do in the consuming client (.net or java) I have decided that I will use the response message type for this purpose. A additional fault message type to return application errors would require additional coding in the SOAP client. This is because the fault structure used by PI to communicate system errors can not be matched or replicated in Integration Builder. It would be nice if the same SOAP fault structure could be used to return application errors. I

Thanks for all your input.

Dieter

Former Member
0 Kudos

Hi Dieter,

As Bhavesh already mentioned fault messages are used for application errors. The same is described in SAP XI help:

http://help.sap.com/saphelp_nw04/helpdata/en/dd/b7623c6369f454e10000000a114084/frameset.htm

In case of system error (e.g. field length too long in proxy call or error in XI/PI mapping) there seems to be no standard way of handling it and propagating the response to the consumer of webservice.

Each system error is not recognized by SOAP adapter and SOAP adapter exception is raised.

The only bizzare solution that I can see is developing an adapter module and transport wrong message to standard fault message before delivering it to adapter engine:

http://help.sap.com/saphelp_nw04/helpdata/en/a4/f13341771b4c0de10000000a1550b0/frameset.htm

Kind regards,

Wojciech

btw nice thread

bhavesh_kantilal
Active Contributor
0 Kudos

>

> The only bizzare solution that I can see is developing an adapter module and transport wrong message to standard fault message before delivering it to adapter engine:

=

Would have been a great idea but alas Sender SOAP adapter's do no support modules. I have heard Stefan say this on the XI forum zillions of times and it has stuck to me as well

hmm.. option option, I was thinking of moving the same to a Java Mapping, but again sigh I wonder if the System Error SOAP messages will go through the mapping runtime.

I am just getting my hands on the 7.1 system this week, this seems to be the first thing I am going to try on 7.1 to see how it can be addressed.

Any other solutions crop up, do let me know.

Regards,

Bhavesh

henrique_pinto
Active Contributor
0 Kudos

>

> Would have been a great idea but alas Sender SOAP adapter's do no support modules. I have heard Stefan say this on the XI forum zillions of times and it has stuck to me as well

It does, if you use Axis Framework.

Former Member
0 Kudos

Ohh I didn't know that. I should use more frequently sdn especially that now it is much better policy on the forum. I think that java or ABAP mapping is still not an option because it won't handle the main integration engine errors. But it might be a solution for system errors on the target system.

P.S.

I wish also to put my hands on PI 7.1 but by that time I have to live with nice XI 3.0.

Best regards,

Wojciech

bhavesh_kantilal
Active Contributor
0 Kudos

>

> It does, if you use Axis Framework.

Ha, technicalities! u got me there

Cheers!

henrique_pinto
Active Contributor
0 Kudos

Hi Dieter,

I'm not sure this subject will be taken into consideration for PI 7.0, since in PI 7.1 these are handled in a different manner. But I'm just guessing.

My sugestion would be that you get your hands onto a PI 7.1 installation and try these scenarios on the newer platform.

PI 7.1 ramp-up has ended and it is in unrestricted shipment as of July 25th, 2008.

Regards,

Henrique.

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Dieter,

A very very interesting thread. Your analysis definitely has made me curious.

I haven't tried this personally but,

1. Your point on XI technical error's not using fault mapping actually makes sense - the way I understand this, the fault messages are basically for Application Error mapping and the fault message mapping is not triggered when a technical error occurs in XI, rather the same message is propogated back to the consumer of the XI exposed web service.

2. In your case hence, it does make to define the fault message to use the standard XI propagated format, but again when I think about it, does XI actually allow you to define such custom fault message format's?

I haven't given this a shot and will definitely give it a try, meanwhile do let me know on your results as well.

As for the WEBAS Soap adapter and AE SOAP adapter returning different error messages,and the example you have provided does make interesting reading but unfortunately I don't have the exact answers to it.

Regards,

Bhavesh