Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to send CDATA inside your SOAP message payload

DZone's Guide to

How to send CDATA inside your SOAP message payload

· Integration Zone
Free Resource

Learn how API management supports better integration in Achieving Enterprise Agility with Microservices and API Management, brought to you in partnership with 3scale

If you need to send a SOAP message payload ever and if it resulted something like this.

<task:customerSchema><ext:value>&lt;maxStops>2&lt;/maxStops></ext:value></task:customerSchema>


Because by default, a StAX parser must be in non coalescing mode (It overrides the default settings mandated by the StAX specification) and as a side effect of that parser coaelsce CDATA sections.

[1] You need to add the XMLInputFactory.properties file with the following entry to CARBON_HOME/ (root) folder.

javax.xml.stream.isCoalescing=false
For more information
[1] http://people.apache.org/~veithen/axiom/userguide/ch04.html#factory.properties

[2] http://wso2.org/forum/thread/10891

Unleash the power of your APIs with future-proof API management - Create your account and start your free trial today, brought to you in partnership with 3scale.

Topics:

Published at DZone with permission of Shelan Perera, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}