Sending invalid XML Characters in Soap Request
I am trying to send special (&
, '
(single quote)) characters in the Soap Request. I am using axis 1.4. The webservice client is in weblogic server and the webservice server is an ibm mainframe (COBOL program).
The request data from the client contains special character (&
symbol) which is converted to &
I tried to enclose it with CDATA as
<![CDATA[Some Name & Some Data ]]>
which got converted to
<![CDATA[Some Name & Some Data]]>
The webservice client is generated from wsdl, so I couldn't use CDATA api to construct the request. I am able to set it as string value, and it is get开发者_如何学编程ting converted.
Any help on this would be greatly appreciated. Please let me know if you need any more information on this.
The web service client stubs are doing the XML encoding for you. The web service expects XML, and it is encoding the &
and '
into entity references so that you will be sending valid XML.
To an XML parser, it will "see" the &
as &
and you don't have a problem.
If the server is unable to handle the entity references, then the COBOL "web service" isn't doing what it is supposed to be doing. That makes it difficult for you(and standards based tools) to generate client stubs from the WSDL, which is essentially a contract that describes the rules for data format and interchange.
What is the point of providing a WSDL and a SOAP service if it doesn't adhere to it's prescribed interface rules?
精彩评论