从ATL C++客户端调用Axis2 web服务
calling Axis2 web service from ATL C++ client
我在Tomcat5.5上使用Axis2发布了一个简单的POJO web服务我试图用ATL C++客户端使用它,但它失败了。对C#客户端执行同样的操作是可行的。问题是ATL客户端发送的soap主体看起来像
<soap:Body>< xmlns="http://fa.test.com/xsd"></></soap:Body></soap:Envelope>
请注意在中间的无效元素。我怀疑这与UTF-8有关,因为C#发送了的头
<?xml version='1.0' encoding='utf-8'?>
而ATL客户端没有。此外,当我研究一些ATLSOAP内部时,我注意到一个结构有两个成员: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>
轴2的响应:
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是空白的。
ATL Server完全能够正确生成请求。看起来WSDL有一些问题。我的粗略测试生成了请求:
<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></soap:Body></soap:Envelope>
对于具有CCD_ 1的ASP.NET Web服务。输入消息中是否有<wsdl:part>
元素?你能发布WSDL服务描述吗?
我认为这与UTF-8无关。
来自C#的有效消息在soap:Body中没有任何内容,而无效消息有。看起来ATLC++客户端试图在SOAP主体中强制执行某些内容,而根本不应该有任何内容。
还要注意,C#客户端的消息中没有包含testResponse元素。
我会进一步查看代码中使用szName的地方,看看这是否是它生成的地方。它不应该那样做。
相关文章:
- 用于将C++代码转换为 Web 程序集的脚本未终止
- C# DLL 从C++应用程序调用 SOAP Web 服务
- OpenCV(C++)处理来自JavaScript / Web Assembly的图像数据
- 用于 progmem 的C++和头文件压缩的 Web 文件字节数组
- 来自带有mbedtls TLS的Mongoose Web服务器的错误消息
- 使用 ESP8266/8285 将字符串从 Web 服务器转换为字节数组
- 在 c++ WWSAPI Web 服务中处理 WS-Security PasswordDigest 模式
- libtorrent是否支持带摘要身份验证的http web种子
- 我的web应用程序的用户需要在浏览器上手动启用本机客户端吗
- Java JNI GDAL 本机库在重新部署为 Web 应用程序时出现类加载器错误
- 如何捕获从 MFC Web 浏览器 c++ 发出的 GET/POST 请求
- 在能够从 Web 浏览器访问大型数组数据的同时存储它的最可行方法是什么?
- 如何为C Web开发配置LAMPP
- 在C/C 接受JSON中创建REST Web服务
- Boost-Beast 异步 Web 套接字 服务器-客户端异步读写 不在控制台上写入输出
- 用于管理 CATIA 文件的 Web 应用程序
- 从QT的Web服务中解析未命名的JSON数组
- 可能在OpenShift3上部署C Web服务器
- 如何使用boost :: asio访问Web服务
- 从ATL C++客户端调用Axis2 web服务