我使用CURL将一条消息发送到webservice。通常,我在CURL命令中传递.xml文件路径,但现在我需要在命令行参数中将整个.xml作为字符串传递。在将路径传递到.xml文档时没有问题,但是当我试图将.xml内容作为字符串传递时,我会得到一个SaxParseException.
命令
Curl -k -v -u username:password -d "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">SOME MESSAGE</soap:Envelope>" endpointurl异常
org.xml.sax.SAXParseException: Open quote is expected for attribute "xmlns:soap" associated with an element type "soap:Envelope". (net.sf.saxon.trans.DynamicError). Message payload is of type: String (org.mule.api.transformer.TransformerMessagingException). Message payload is of type: String* Closing connection 0发布于 2014-04-12 18:52:56
解决:由于某些原因,它不喜欢xmlns:soap属性中的双引号。移除它们就行了。
https://stackoverflow.com/questions/21534591
复制相似问题