cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping SOAP Fault during synchronous SOAP call

0 Kudos

We are building a mediated service scenario where PI is brokering a synchronous SOAP call, without changing any of the information being sent or received (the mappings use the same source and target data types with no transformations). When the service is successfully executed everything works as expected, but when the target service returns a SOAP fault, PI appears to be wrapping the fault in a separate fault before returning it to the client. Why is this happening? Is there a way to simply return the SOAP fault to the client without adding the additional wrapper?

Here is the fault received from the target service when called directly:

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

<soapenv:Header/>

<soapenv:Body>

<soapenv:Fault>

<faultcode>Missing_Required_Data</faultcode>

<faultstring>**Required data is invalid : Dealer Country**</faultstring>

</soapenv:Fault>

</soapenv:Body>

</soapenv:Envelope>

Here is the fault received from the mediated PI service call:

<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.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIAdapterFramework:GENERAL:com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: **Required data is invalid : Dealer Country**

at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1161)

at sun.reflect.GeneratedMethodAccessor948.invoke(Unknown Source)

...

...

...

</s:SystemError>

</detail>

</SOAP:Fault>

</SOAP:Body>

</SOAP:Envelope>

Why aren't they the same?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kurt, did you ever come up with a good solution here?

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

are diferents coz the first is a fault message and the second is a exception message.

to send back the fault message define a fault message for both structure and map them in a new message mapping. later in the operation mapping or interface mapping (depends of the pi version) under fault message or fault mappinng (i dont remember) tab assisg the fault message mapping.

thats all you need.