Skip to Content
author's profile photo Former Member
Former Member

Schema Validation

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 -->">




<faultstring>Server Error</faultstring>










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.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2007 at 10:27 PM

    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.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.