cancel
Showing results for 
Search instead for 
Did you mean: 

XML String in Webservice

silentbull
Participant
0 Kudos

Hi,

I have a proxy to webservice scenario.

Since the webservice is not capable to accept multiple records, they have asked to concatenate the entire recordset into one xml string.

So obviously, they will just have one string where I need to send the entire proxy structure data.

How do i achieve this since I have a structure with Header and Detail records.

Do i simply just concatenate all fields and send it or should i need to do any special function?

Will the concatenation happen with xml structure or only the data.

REgards

Sam

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Sam,

This is very simple, I used it in one of my scenarios. Simply map your root element to the required target field, and then enable the "Return as XML" option, as below:

Regards,

Greg

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sam,

              Could you please post a sample source and target XML, if possible.

Regards

Anupam

Former Member
0 Kudos

Hello,

So u want to send entire proxy message to WS in a single XML string format?

If yes, then u can use "ReturnAsXML" functionality (+ use replace string function to remove the XML declaration from input message) and send the entire proxy data in XML string...

Thanks

Amit Srivastava

silentbull
Participant
0 Kudos

Hello All

I am using PI 7.01 and could not find the option Return as XML. Is it not available in this version.

former_member184681
Active Contributor
0 Kudos

Hi Sam,

With PI 7.0 it's still possible, but you need to go for a little workaround with Java mapping. See it clearly described in this Wiki page:

http://wiki.scn.sap.com/wiki/display/XI/Java+Mapping-+Convert+the+Input+xml+to+String

Mapping Java code included

Regards,

Greg

rhviana
Active Contributor
0 Kudos

Amit,

You can use a XSLT mapping or javamapping for it.

If you will use java mapping, I recommend use DOM than SAX.

Check link below:

http://wiki.scn.sap.com/wiki/display/Snippets/Java+Mapping+-+Convert+the+Input+xml+to+String

Or the link provide by

XSLT link below, it´s full, you dont need to use choose or if..

http://lenzconsulting.com/xml-to-string/xml-to-string.xsl

Kind regards,

BR.

Viana.