on 06-22-2010 4:04 PM
My requirement is I need to put the whole payload string with in CDATA tag.
Iam getting payload as String from SAP R/3 into XI and to third party system. Tird party system needs whole payload string with in CDATA tag.
When I do that all angular brackets, quotations, ampersand <, >, ", & are turning to special characters > , < .
Please advise.
> Iam getting payload as String from SAP R/3 into XI and to third party system.
> When I do that all angular brackets, quotations, ampersand <, >, ", & are turning to special characters > , < .
When you receive the whole payload as string, then the sender escapes the <,>,&. not PI
So your task is to de-escape the incoming string and put CDATA around?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use an XSLT to perform this task
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> >Tird party system needs whole payload string with in CDATA tag.
>
> What does means by this post? when you say whole payload..it means you are talking about complete xml..right?
>
> Are you sure that what you post is equal to what you implemented?
Yes I mean whole payload, remember Isaid whole payload is coming as string.
As I said it may not the good way to wrap the whole payload in CDATA, but it is working.
I tried Java map using DOM Parser, but I was stuck while the passing the input I received in output.
DocumentBuilder builderel = factory.newDocumentBuilder();
//Document docIn = builderel.parse(in);
//Create the output DOM
Document docOut = builderel.newDocument();
String msgName = "ns1:abcXMLRequest";
String nameSpace="urn:com.abcdef.schemas:enttechservice:abc";
root = docOut.createElement(msgName);
root.setAttribute("xmlns:ns1", nameSpace);
docOut.appendChild(root);
Element idEl = docOut.createElement("applicationXMLString");
root.appendChild(idEl);
CDATASection cd = docOut.createCDATASection( got stuck here it expects a string argument here); // I need to pass the input I recived in to XI as it is.
root.appendChild(cd);
domS = new DOMSource(docOut);
Hi Vamsi,
If you are on PI 7.1 then you can see this blog:
/people/jyothi.anagani/blog/2010/06/17/convert-the-input-xml-to-string-in-pi-71-using-standard-graphical-mappingSDNWeblogs_SapExchangeInfrastructurexi%2528SAPNetworkWeblogs%253ASAPExchangeInfrastructure%2528XI%2529%2529
If other versions simple xsl mapping should do. See the code here:
Regards,
---Satish
Hi Vamsi,
have a look at this blog /people/danny.deroovere/blog/2008/11/30/how-to-map-cdata-to-a-structured-message-in-xi
Regards,
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Srinivas,
This blog tell to strip the CDATA tag and extract the XML out of it.
I want wrap the whole payload into a CDATA tag.
Stefan,
The reason why Iam doing this, after XI, it is passing through another infrastrcutre (non SAP) and it does a schema validation,before the message goes to third party system
To make sure the infrastrcture does not fail, we need to wrap the whole payload string in to a CDATA tag.
I have implemented a solution here, not sure if it is a good way.
I have created three varibales at my target data structure and assigned constants like below
var1 = <![CDATA[
var2 = normal mapping from source element (I mentioned I have only one element in my source)
var3 = ]]
target_element1
I have concateneted var1 + Var2 + var3 and mapped to target_element1.
Surprisingly it worked for me, not sure if it is a good way.
> My requirement is I need to put the whole payload string with in CDATA tag.
There have been a lot of same questions recently. I wonder why an application requests an XML, where another XML is hidden in a CDATA section? Can somebody explain it to me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.