Reputation: 66797
I am trying to consume a soap server. Values needs to be sent which may contain certain special chars, namely '
, &
, $
:
, and *
, e.g.:
foo'bar&$bazz:*
I now that the value is correct, as I can consume the soap api indirectly through an external webfrontend that internally communicates with the soap server. I do not know what kind of transformation it applies to the payload nor do I have access to check.
I wonder: Is there a common way to escape / encode special chars for soap requests?
I tried using cdata:
<![CDATA[foo'bar&$bazz:*]]>
I tried using escape sequences:
& (ampersand): &
' (apostrophe or single quote): '
yet all to no avail.
I am trying to contact the provider of the soap service, yet in the meantime I wonder if there is a common escaping strategy that I can employ that should be default for soap servers to understand.
Upvotes: 1
Views: 2614
Reputation: 66797
The escape strategy that worked for me was to not escape the '
but only the &
like this:
foo'bar&$bazz:*
Upvotes: 1