Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create SOAP request with CDATA #15

Closed
pzienowicz opened this issue Jul 12, 2017 · 5 comments
Closed

How to create SOAP request with CDATA #15

pzienowicz opened this issue Jul 12, 2017 · 5 comments

Comments

@pzienowicz
Copy link

pzienowicz commented Jul 12, 2017

Hi,

Is there any way to send eg. html code in CDATA tag?
When I add text node like this:
<![CDATA[ <Request> <Authentication CMId="68" Function="1" Guid="5594FB83-F4D4-431F-B3C5-EA6D7A8BA795" Password="poihg321TR"/> <Establishment Id="4297867"/> </Request> ]]>

The problem is:
<![CDATA[ ]]>
is displaying like
&lt;![CDATA[ and ]]&gt;

Thanks!

@AlexGilleran
Copy link
Owner

I don't know of any way with the current API.

Looks like it's possible with XMLSerializer though, so it should be possible to add: https://developer.android.com/reference/org/xmlpull/v1/XmlSerializer.html#cdsect(java.lang.String)

@pzienowicz
Copy link
Author

pzienowicz commented Jul 13, 2017

Could you provide me any example?
How can I use it with com.alexgilleran.icesoap.envelope.impl.BaseSOAP11Envelope?

@AlexGilleran
Copy link
Owner

I think you could create a XMLCDataNode class that extends XMLTextNode, and override serializeContent to use XMLSerializer.cdsect(getValue()) instead of XMLSerializer.text. Then you could add it to any existing envelope or XMLNode with addElement

@pzienowicz
Copy link
Author

Works like a charm.
Thank you @AlexGilleran!

@AlexGilleran
Copy link
Owner

Yay! No worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants