Java – send invalid XML characters in soap request
I want to send special (&, '(single quotation mark)) characters in soap request I use axis 1.4 The web service client is located in the WebLogic Server, which is the IBM host (COBOL program)
The request data from the client contains special characters (& symbols), which are converted to & amp; amp; amp; amp; amp; amp; amp;
I tried to encapsulate it with CDATA
<! [CDATA [some name & some data]] > Convert to
<![CDATA[Some Name & Some Data]]>
Web service clients are generated from WSDL, so I can't use CDATA API to construct requests I can set it to a string value, and it is being converted
Any help in this regard will be greatly appreciated If you need more information, please contact us
Solution
The web service client stub is performing XML encoding for you The web service needs XML, and it is encoding & and 'into entity references so that you will send valid XML
For the XML parser, it will "see" & amp; amp; As & and you have no problem
If the server cannot process entity references, the COBOL web service will not perform what it should This makes it difficult for you (and standards based tools) to generate client stubs from WSDL, which is essentially a contract describing data formats and exchange rules
If WSDL and soap services do not comply with the specified interface rules, what is the focus of providing it?