How can CDATA can be sent in consumed web service?
Question

I have consumed web service in outsystems and want to send CDATA in one of the elements.

When i send like below it fails.


"<![CDATA[This is example cdata]]>"

Error:

Failed to create alerts
org.apache.cxf.binding.soap.SoapFault: Failed to create alerts
   at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84)
   at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51)
   at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40)
   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
   at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
   at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:140)
   at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)
   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
   at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:849)
   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1642)
   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1520)
   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1317)
   at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
   at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
   at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
   at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572)
   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)
   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)

mvp_badge
MVP

Hello Thirupathi,

Can you show how are you defining this value and calling the method?

Cheers.

Thanks Eduardo for responding, looks like service issue, we are reviewing. will get back when i have more details.

mvp_badge
MVP

Hope it is something easy to solve :)

Cheers

I got logs from service team, looks like platform is encoding so its failing.

I have inputted (harcoded) string like below as expression in consumed web service

<reason1><![CDATA[Example* Test sample's]]></reason1>

the log shows like below (see red bold and underlined) 

<reason1>&lt;![CDATA[Example* Test sample's]]&rt;</reason1>

Is there a solution to this issue? We're having the same problem.

any updates for this issue thread? I am having the same.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.