SOAP响应错误 - 不能包含<字符

时间:2016-04-22 04:25:46

标签: soap wsdl

将错误视为

java.lang.RuntimeException: Exception in preInvoke : javax.xml.soap.SOAPException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 47; The value of attribute "arasAML" associated with an element type "tcin:applyAMLInTCInputData" must not contain the '<' character.

我正在SOAP用户界面中测试我的网络服务,下面是SOAP请求。

<soapenv:Envelope xmlns:soapenv="schemas.xmlsoap.org/soap/envelope/"; xmlns:tcin="de4.com/Schemas/TCIntgn/2013-05/TCIntegration">; <soapenv:Header/> <soapenv:Body> <tcin:ApplyAMLInTCInput> <tcin:applyAMLInTCInputData arasAML="<XML><REVISIONS><ITEM_REVISION><itemNo>000147</itemNo><type>PDF,DirectM‌​odel,MSPowerPointX</type></ITEM_REVISION></REVISIONS></XML>" message="DownloadDatasetFile" > </tcin:applyAMLInTCInputData> </tcin:ApplyAMLInTCInput> </soapenv:Body> </soapenv:Envelope>

获得SOAP响应如下

     <faultstring>java.lang.RuntimeException: Exception in preInvoke : javax.xml.soap.SOAPException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 47; The value of attribute "arasAML" associated with an element type "tcin:applyAMLInTCInputData" must not contain the '&lt;' character.</faultstring>

1 个答案:

答案 0 :(得分:0)

如果数据包含特殊字符,则需要对数据进行URL编码或将其放入CDATA块中。和&gt;。