cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the whole payload

Former Member
0 Kudos

Hey guys,

I have a requirement where I need to call a stored procedure through a JDBC adapter. The particularity in this call is that I need to send the complete source XML payload as a string in just one element and not mapping each element with input variables of the store procedure.

I need to know if there is a way to get the incoming XML payload as one big String within XI.

Any inputs will be helpful !!!

Cheers,

Mauricio

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

This is not possible using Graphical Mapping. You need to look into Java / XSL or ABAP mapping to do the same.

REgards,

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

Any example of this using Java mapping or XSLT mapping ??

Cheers,

Mauricio

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

When you write a JAVA Mapping , you need to implement the StreamTransfromationClass which implements execute and setParameter methods.

In the execute method , you get the Source XML as an InputStream and the need to push the Output XML as the output stream.

You can use a DOM or SAX parser to prase the XML source and create the target XML.

To get the entire Source into s String, use this code,


BufferedReader in = new BufferedReader(new InputStreamReader(inp));
StringBuffer buffer = new StringBuffer();
String line="";
while ((line = in.readLine()) != null) {
buffer.append(line);
}
String sourcexml=buffer.toString();

Take a look at thise blog for Java Mapping,

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

Regards,

Bhavesh

Former Member
0 Kudos

Bhavesh,

Thanks for the help. Points awarded to you...

Cheers,

Mauricio

Answers (0)