我尝试使用apache CXF客户端调用o SOAP Web服务时出现上述错误。我尝试使用SOAP12HTTP_BINDING修复此错误,但随后出现以下错误:
org.w3c.dom.DOMException:层次请求错误:试图在不允许的位置插入节点
出站消息如下:
Address: myHostName
HttpMethod: POST
Content-Type: text/xml
ExchangeId: myExchangeId
ServiceName: myServiceName
PortName: myPortName
PortTypeName: DummyImpl
Headers: {SOAPAction="mySoapAction",
Accept=*/*, Host=myHost,
Accept-Encoding=gzip,deflate,
Content-Type=application/soap+xml;
charset=UTF-8;action="}
Payload: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="myNamespace">
<soapenv:Body>
<a:operatioName>
...
</a:operatioName>
</soapenv:Body>
</soapenv:Envelope>
1条答案
按热度按时间z4bn682m1#
原来问题出在Content-Type头上,我把它改成了text/xml; charset=UTF-8,并且它成功了。