cancel
Showing results for 
Search instead for 
Did you mean: 

How to send the SOAP Fault Message to the Web Service Consumer

Former Member
0 Kudos

Hi,

I have configured SAOP to Proxy Syncronous Scenario in PI 7.1 and using XML Validation in Adapter Engine to Validate the Structure of the Message Payload.The scenario is working fine.When some of the Filed's Length increses the maxLength specified in the Data Type . We are getting the Following error.


<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.MessageFormatException: XML Validation for payload with root element name MT_Out_CustomerMaster_FPMReq , target namespace http://Pegasystems.com/I06_Customers Failed!Errors Encountered During Parsing 
1.cvc-maxLength-valid: Value '123456789' with length = '9' is not facet-valid with respect to maxLength '8' for type 'null'.
2.cvc-type.3.1.3: The value '123456789' of element 'CompanyCode' is not valid.
3.cvc-maxLength-valid: Value 'asdf' with length = '4' is not facet-valid with respect to maxLength '1' for type 'null'.
4.cvc-type.3.1.3: The value 'asdf' of element 'OperationType' is not valid.

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

My question is How does the Web Service Consumer can handle this Soap Server Error in the SOAP Fault.Or How can we provide a specific information like 'The value '123456789' of element 'CompanyCode' is not valid.It exceeds the Maximum Length'.

I read this /people/sap.user72/blog/2006/01/16/xi-propagation-of-meaningful-error-information-to-soap-client blog .Where it is mentioned that the Web Service Consumer can handle while calling the Web Service.Is there any other solution?

Kindly appreciate your help.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank You Stefan for your kind reply.

So you mean to say if we use the XML Validation .we cannot provide proper error information to the calling Web Service Consumer .And While calling a Web Service they cannot Extract the Exact Message in the Text Filed(<text>) present under the Detail Element (<detail>) in the <SOAP:Fault> node. as


<text>com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: XML Validation for payload with root element name MT_Out_CustomerMaster_FPMReq , target namespace http://Pegasystems.com/I06_Customers Failed!Errors Encountered During Parsing 
1.cvc-maxLength-valid: Value '123456789' with length = '9' is not facet-valid with respect to maxLength '8' for type 'null'.
2.cvc-type.3.1.3: The value '123456789' of element 'CompanyCode' is not valid.**
3.cvc-maxLength-valid: Value 'asdf' with length = '4' is not facet-valid with respect to maxLength '1' for type 'null'.
4.cvc-type.3.1.3: The value 'asdf' of element 'OperationType' is not valid.

That is why we have to use the Fault messages and Field Lengths has to be Validated in the Server proxy.

Please Correct me If I am wrong.

VijayKonam
Active Contributor
0 Kudos

Yes. You would have to carryout the validation in your server proxy (SOAP Service provider) and through and exception if something is not valid. This would convert in to a Fault Message on PI. You have to create Fault Messages

using the fault data types and a mapping has to be created for the fault tab in the interface mapping..

VJ

stefan_grube
Active Contributor
0 Kudos

The SOAP fault message can only be set by the web service provider.

So you have to do the validation in the application instead of using the XML Validation in Adapter Engine.