Soap XML中的tilde
tilde是XML SOAP消息中的合法字符吗?我得到一个SAXParseException:prolog中不允许的内容。我包含了大部分SOAP消息,以防我找错了方向Soap XML中的tilde,soap,xml-serialization,Soap,Xml Serialization,tilde是XML SOAP消息中的合法字符吗?我得到一个SAXParseException:prolog中不允许的内容。我包含了大部分SOAP消息,以防我找错了方向 POST /... HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.4 Host: 127.0.0.
POST /... HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: 127.0.0.1:1234
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1497
Authorization: Basic b3BlbnBkbTpvdHRvMTIz
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:query soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://localhost">
<where xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">type ~~ 'command'</where>
</ns1:query>
</soapenv:Body>
</soapenv:Envelope>
POST/。。。HTTP/1.0
内容类型:text/xml;字符集=utf-8
接受:应用程序/soap+xml、应用程序/dime、多部分/相关、文本/*
用户代理:Axis/1.4
主持人:127.0.0.1:1234
缓存控制:没有缓存
Pragma:没有缓存
SOAPAction:“
内容长度:1497
授权:基本B3BLBNBKBPVDHRVMTIZ
键入~~'命令'
tilde是XML SOAP消息中的合法字符吗
对。错误消息指向另一个错误源(“prolog”)。HTTP头是否可能是发送到SAX解析器的代码的一部分,如您的代码示例中所示?我不确定是否有SOAP消息,但在处理XML文件时,出现此错误消息的另一个可能原因是文件开头有一个错误-如果配置或调用不正确,某些XML解析器无法处理该错误。检查(使用十六进制编辑器)并尝试如果删除它会发生什么 例如,在Python中,有必要使用
codecs.open(filename,“UTF-8”)
而不仅仅是open(filename)
打开UTF-8编码的XML文件,以确保正确处理BOM(如果存在)