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

http://schemas.xmlsoap.org/soap/envelope/">

<SOAP:Body>

<SOAP:Fault>

<faultcode>SOAP:Server</faultcode>

<faultstring>Server Error</faultstring>

<detail>

http://sap.com/xi/WebService/xi2.0">

<context>XIAdapter</context>

<code>RecoverableException</code>

<text><![CDATA[

com.sap.aii.af.ra.ms.api.DeliveryException: Application:STREAM_TRANSFORMATION_EX:

at com.sap.aii.adapter.xi.ms.XIEventHandler.onTransmit(XIEventHandler.java:453)

at com.sap.aii.af.ra.ms.impl.core.queue.CallConsumer.onMessage(CallConsumer.java:131)

at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:834)

at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

]]></text>

</s:SystemError>

</detail>

</SOAP:Fault>

</SOAP:Body>

</SOAP:Envelope>

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.

Thanks,

Badari

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.

    Venu

    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) {

      this.createExceptionOutput(spe.getMessage(),

      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.

      Thanks,

      Badari

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.