Skip to Content

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

handling Soap Fault Response.

Hi All,

I have a Proxy to SOAP scenario.

While testing from SoapUI --

I am getting response for the valid input and for the invalid input the response is below.

In the scenario through SAP PI , the valid input given from the HTTP client is getting a valid response and the scenario is running fine.

But while checking the negative test, giving the invalid input, it is ending in a System error in PI.

We have to handle this and send the error back to the source system.

FAULT RESPONSE IN SoapUI :

-


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

<soap:Body>

<soap:Fault>

<faultcode>soap:Client</faultcode>

<faultstring>System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (6, 45). ---> System.InvalidOperationException: Instance validation error: 'AD' is not a valid value for Currency.

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read1_Currency(String s)

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2_ConversionRate()

at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader)

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

--- End of inner exception stack trace ---

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()

--- End of inner exception stack trace ---

at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()

at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</faultstring>

<detail/>

</soap:Fault>

</soap:Body>

</soap:Envelope>

-


*System error message in SAP PI* :

-


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Inbound Message --> <SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SAP:Category>XIAdapterFramework</SAP:Category><SAP:Code area="MESSAGE">GENERAL</SAP:Code><SAP:P1/><SAP:P2/><SAP:P3/><SAP:P4/><SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: System.Web.Services.Protocols.SoapException: Server was unable to read request. ---&gt; System.InvalidOperationException: There is an error in XML document (1, 328). ---&gt; System.InvalidOperationException: Instance validation error: 'US' is not a valid value for Currency.

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read1_Currency(String s)

at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2_ConversionRate()

at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader)

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

--- End of inner exception stack trace ---

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()

--- End of inner exception stack trace ---

at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()

at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</SAP:AdditionalText><SAP:Stack/><SAP:Retry>M</SAP:Retry></SAP:Error>

-


I want to capture the text in Fault string in the Fault response and send it back to the Source system.

I have referred many blogs but i am unable to do it.

Will java mapping work as this is a response from the Target Webservice and NOT an errorin PI.

Helpful Answer

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