cancel
Showing results for 
Search instead for 
Did you mean: 

CDATA element deleted in SOAP receiver adapter

Former Member
0 Kudos

Hello Everybody!

I've got a problem with SOAP receiver adapter. I've made a mapping for synchronous HTTP -> XI -> SOAP interface, in which the request mapping is java mapping, which produce a message like this:

**********************

<?xml version="1.0" encoding="UTF-8"?> <ns0:SaveISDocument xmlns:ns0="http://pl.optix.pl/aews">

<ns0:xmlDocument><IMAGES><IMAGE FileName="tmp.xml" ClassName="IVX">

<![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMiI/Pgo8SU5WT0lDMDECiAgPElET0MCiAgICAgPEVESV9EQzQwPgogICAgICA8VEFCTkFNPkVESV9EQzQwPC9UQUJOQU0CiAgICAgIDxNQU5EVD4zMDwvTUFORFQCiAgICAgIDxET0NOVU0OTAzMTAyMzA4MzwvRE9DTlVNPgogICAgICA8RE9DUkVMPjQ1QjwvRE9DUkVMPgogICAgICA8U1RBVFVTPjMwPC9TVEFUVVMCiAgICAgIDxESVJFQ1QMTwvRElSRUNUPgogICAgICA8T1VUTU9EPjI8L09VVE1PRD4KICAgICAgPElET0NUWVASU5WT0lDMDE8L0lET0NUWVACiAgICAgIDxDSU1UWVAWjFJTlYwMTwvQ0lNVFlQPgogICAgICA8TUVTVFlQPklOVk9JQzwvOVk9JQzAxPgo=]]>

</IMAGE></IMAGES>

</ns0:xmlDocument></ns0:SaveISDocument>

********************

In CDATA is a Base64 representation of some file.

I hoped at oubound of SOAP adapter sholud be something like this:

**********************

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header/><SOAP:Body><ns0:SaveISDocument xmlns:ns0='http://pl.optix.pl/aews'>

<ns0:SaveISDocument xmlns:ns0="http://pl.optix.pl/aews">

<ns0:xmlDocument><IMAGES><IMAGE FileName="tmp.xml" ClassName="IVX">

<![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMiI/Pgo8SU5WT0lDMDECiAgPElET0MCiAgICAgPEVESV9EQzQwPgogICAgICA8VEFCTkFNPkVESV9EQzQwPC9UQUJOQU0CiAgICAgIDxNQU5EVD4zMDwvTUFORFQCiAgICAgIDxET0NOVU0OTAzMTAyMzA4MzwvRE9DTlVNPgogICAgICA8RE9DUkVMPjQ1QjwvRE9DUkVMPgogICAgICA8U1RBVFVTPjMwPC9TVEFUVVMCiAgICAgIDxESVJFQ1QMTwvRElSRUNUPgogICAgICA8T1VUTU9EPjI8L09VVE1PRD4KICAgICAgPElET0NUWVASU5WT0lDMDE8L0lET0NUWVACiAgICAgIDxDSU1UWVAWjFJTlYwMTwvQ0lNVFlQPgogICAgICA8TUVTVFlQPklOVk9JQzwvOVk9JQzAxPgo=]]>

</IMAGE></IMAGES>

</ns0:xmlDocument></ns0:SaveISDocument>

</SOAP:Body></SOAP:Envelope>

*************************

Unfortunatelly there is something like:

***************************

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header/><SOAP:Body><ns0:SaveISDocument xmlns:ns0='http://pl.optix.pl/aews'>

<ns0:SaveISDocument xmlns:ns0="http://pl.optix.pl/aews"><ns0:xmlDocument><IMAGES><IMAGE FileName="tmp.xml" ClassName="IVX">

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMiI/Pgo8SU5WT0lDMDECiAgPElET0MCiAgICAgPEVESV9EQzQwPgogICAgICA8VEFCTkFNPkVESV9EQzQwPC9UQUJOQU0CiAgICAgIDxNQU5EVD4zMDwvTUFORFQCiAgICAgIDxET0NOVU0OTAzMTAyMzA4MzwvRE9DTlVNPgogICAgICA8RE9DUkVMPjQ1QjwvRE9DUkVMPgogICAgICA8U1RBVFVTPjMwPC9TVEFUVVMCiAgICAgIDxESVJFQ1QMTwvRElSRUNUPgogICAgICA8T1VUTU9EPjI8L09VVE1PRD4KICAgICAgPElET0NUWVASU5WT0lDMDE8L0lET0NUWVACiAgICAgIDxDSU1UWVAWjFJTlYwMTwvQ0lNVFlQPgogICAgICA8TUVTVFlQPklOVk9JQzwvOVk9JQzAxPgo=

</IMAGE>

</IMAGES></ns0:xmlDocument></ns0:SaveISDocument>

</SOAP:Body></SOAP:Envelope>

********************************

... which is not correct, because CDATA tags are lost!

Anyone has idea, how to enable adapter to process message right?

Best regards,

Mikolaj

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Henrique:

As I wrote - the webservice was wrote by 3rd party software supplier - so I wasn't sure if I could change a specification at this point - that was a reason why I needed a CDATA element. A CDATA element was at entry of this webservice and I couldn't send to it my data correctly using XI. That was a problem. Hope You got it now.

Finally I've managed the problem because 3rd party software supplier agreed to change their service and use <CDATA> tag instead of CDATA element.

I solved the problem but my question still remain not answered.

At OSS I was asked to upload latest SP (now I've got 12 at Java Stack).

If this will help I'll close this thread.

Best regards

Mikolaj

Former Member
0 Kudos

Thanks for reply, but:

1. VJ: I can see my CDATA tag at monitor (I' ve made some trace output at my java mapping), but between XI and WebService CDATA tag is deleted, what I can see at tcpgw tool.

2. Henrique: I asked my question because CDATA tag is a part of XML specification and in current project some 3rd party software supplier supports CDATA tags at WS input. What I'm asking is: Why SAP doesn't support the full XML specification at SOAP adapter, or how to enable it.

According to "why use CDATA section?" - I just don't know if I could change specification at this point...

Best regards,

Mikolaj

henrique_pinto
Active Contributor
0 Kudos

Mikolaj,

I'll reask my question: "why to necessarily use CDATA?"

Any XML compliant application should correctly process both

<![CDATA[<tag/>]]>

and

<tag/>

as valid text inputs.

Also, XI is fully compliant with XML standards: it processes both CDATA and escaped text inputs. If you really read XML specification (instead of just speculating about it), you won't find anything about compliant applications having to output CDATA tags.

And, finally, why do you need CDATA anyway??? BASE64 content doesn't have any XML-special characters...

Regards,

Henrique.

henrique_pinto
Active Contributor
0 Kudos

The CDATA tags, as defined in XML specification, are used when you want to say to your application

not to consider its content as XML data. Hence, all XML special chars which are not usually

supported in common string fields ('<', '>', '&' etc.) can be sent in a CDATA tag without any

worries (since the consumed application shouldn't parse it anyway).

Also, as defined by XML specification, CDATA tags are to be used in the input of such

applications and are never to be expected in their output.

Since XI SOAP adapter probably uses JAX (Java API for XML) for XML handling, whenever its input

is a XML with CDATA tags, it will consider the content of CDATA tags as string and not as XML

data. In the end of its processing, the SOAP adapter will parse the content of the CDATA tag as

a valid XML string. So, for example, if you have

<test><![CDATA[<test/>]]>

in your input xml, the output of SOAP adapter will be

<test><test/></test>

, and both representations should be completely understanded by any applications

implementing XML specifications.

In your case, the SOAP adapter is escaping the Base64 string and the output of the escaping

is exactly the same string (since there aren't any xml special chars in the string).

It's not like SOAP adapter is removing CDATA tag, it's just that there's no reason

for such tag there.

Now, that all being said, why do you specifically needs a CDATA tag in the message

which is sent to the web service you acessing? Isn't the application able to read the

Base64 content from the XML field?

Regards,

Henrique.

VijayKonam
Active Contributor
0 Kudos

Hi Mikolaj,

The CDATA blocks are not lost but XI hides them. When you look at the message as view source by right clicking in SXMB_moni or in the mapping test tab by clicking the pretty printer kind of button.. it will shouw you the CDATA elements.

VJ