cancel
Showing results for 
Search instead for 
Did you mean: 

Content Modifier not changing body in SAP CPI

0 Kudos

Hello Gurus,

While working with CPI Content Modifier to switch the body of a message I am having an issue. I have a CDATA coming in a XML and I need to make the CDATA my new "body" for the iFlow. I assign the CDATA to a property (which I know it Works because I see the property correctly populated in the trace), but the body is not being changed, thus, my iFlows dumps at the moment I reach an XML I see the following error:

org.apache.camel.ExpectedBodyTypeException: Could not extract IN message body as type: interface javax.xml.transform.Source body is: <body itself>.

Can you provide any input? I am really desperate.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Morten, I was trying to switch the body for a property, so in the "Message Body" tab I was writing ${property.Name}.

This was making the XSLT to fail. What I did make it work is to add "<tag>${property.Name</tag>" in the "Message body" tab, and then adjust the XSLT to fit the new structure of the XML.

Luckily, this new 'body' did not begin with and "<?XML...." because, if it does, it would make the XSLT fail again due to a bad forming of the structure.

Thank you so much for the aid.

MortenWittrock
Active Contributor
0 Kudos

Hi Fernando

You are right to be careful when treating XML as text; it can go wrong.

If you found my answer helpful, please consider accepting or upvoting it.

Regards,

Morten

MortenWittrock
Active Contributor
0 Kudos

Hi Fernando

Which step fails? It sounds to me like it's a step expecting an XML document, but the property does not, in fact, contain an XML document.

Could you show the exact contents of the property, after you've extracted the CDATA section? If special characters are escaped, it's no longer an XML document.

Regards,

Morten