我在 Tomcat5.5 上使用 Axis2 发布了一个简单的 POJO Web 服务,我尝试使用 ATL C++ 客户端使用它,但它失败了。对 C# 客户端执行相同的操作。问题是 ATL 客户端发送的肥皂体看起来像
<soap:Body>< xmlns="http://fa.test.com/xsd"></></soap:Body></soap:Envelope>
注意中间的无效元素。我怀疑它与 UTF-8 有关,因为 C# 发送的标头
<?xml version='1.0' encoding='utf-8'?>
而 ATL 客户端则没有。此外,当我查看一些 ATL SOAP 内部时,我注意到一个结构有两个成员:szName 和 szwName。第一个是空的并产生元素,第二个有一个有效的(?)名称 testResponse(我调用的方法称为“test”)。
需要关于从这里去哪里的建议?
更多详细信息:来自 ATL 客户端的完整消息:
POST /axis2/services/EnterpriseService.EnterpriseServiceHttpSoap11Endpoint/ HTTP/1.1
Content-Length: 304
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:test"
Accept: text/xml
Host: xxxxxxx
User-Agent: Microsoft-ATL-Native/8.00
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><soap:Body>< xmlns="http://fa.test.com/xsd"></></soap:Body></soap:Envelope>
来自 Axis2 的响应:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 04 Nov 2008 15:31:57 GMT
Connection: close
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '>' (code 62); expected an element name.
at [row,col {unknown-source}]: [1,276]</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
哦,这是来自 C# 客户端的好请求:
POST /axis2/services/EnterpriseService.EnterpriseServiceHttpSoap11Endpoint/ HTTP/1.1
Via: 1.1 ANGEL-ISLAND
Content-Type: text/xml; charset=utf-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)
Host: xxxxxxx:8080
SOAPAction: "urn:test"
Connection: Keep-Alive
Content-Length: 236
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body /></soap:Envelope>
在 C# 的情况下,soap:body 是空白的。