Showing results for 
Search instead for 
Did you mean: 

Schema Validation

Former Member
0 Kudos

I have written a java program to do schema validation and implemented/tested it successfully in interface mapping in XI.

When the validation succeeds, I am forwarding the input message to a receiving system.

When the validation fails, I am creating an error response using xsl - named outputMessage. outputMessage is of javax.xml.transform.Result type.

Throwing StreamTransformationException(new StringBuffer().append(outputMessage).toString()); is giving the following error message:

<?xml version="1.0"?>

<!-- see the documentation -->

<SOAP:Envelope xmlns:SOAP="">




<faultstring>Server Error</faultstring>


<s:SystemError xmlns:s="">









at Method)









How do I send my customized error message 1. either as a normal response 2. or as a fault response.

I have read through many blogs and forum messages on SDN but couldn't figure this out.

Any help is appreciated.



Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Badari,

I didn't try these following ideas, but one of those should work

1) In your java mapping before throwing exception,set a Globalcontainer parameter (eg:errMsg).In exception block of the original mapping put another mapping in which we get the globalcontainer parameter which we set before and use it..

2)Do not throw StreamTransformationException.. but create a status message which has Success or Fail flags with error message.Based on the status flag change the process flow..

Both of these ideas are not one step solutions as you are trying to acheive...

Good hear from you Badari.


Former Member
0 Kudos

Hi Venu, good to hear back from you too. Here are salient points of my implementation:

1. No usage of BPM.

2. This is a synchronous SOAP call from a client.

3. The input message should go through the interface mapping defined at the time of Interface Determination.

4. Successful input message (if schema validation is success) should go to to a receiving ECC system for processing.

5. If schema validation fails, I should stop the sync call at XI itself and send back the detailed error message either as a normal SOAP response or as a SOAP Fault Response.

This is an independent Java class and not a UDF. Here is the exception block code snippet:

catch (SAXParseException spe) {


inputMessage, outputMessage);

throw new StreamTransformationException(new StringBuffer().append(outputMessage).toString());


If I don't throw an exception (StreamTransformationException), XI doesn't detect any error and simply passes on the error output message ( created by createExceptionOutput method ) to the receiving system ! The receiving system fails to process the message and sends back ABAP Processing Error. But, my objective is to stop the incorrect input message at XI itself and not do any further processing.