VC 通过HTTP调用webservice请求数据

lijianli9 lijianli9 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_POST,
"/HelloWorldService/services/HelloWorld.asmx", NULL, 0, NULL, NULL, m_dwHttpRequestFlags);
pFile->AddRequestHeaders("Content-Type: text/xml; charset=utf-8", HTTP_ADDREQ_FLAG_ADD);
pFile->AddRequestHeaders("SOAPAction: \"http://tempuri.org/exampleMessage\"", HTTP_ADDREQ_FLAG_ADD);

strData += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
strData += "\r\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">";
strData += "\r\n\t<soap:Body>";
strData += "\r\n\t\t<exampleMessage xmlns=\"http://tempuri.org/\">";
strData += "\r\n\t\t\t";
strData += SetXmlSection("in0", "hello", szXmlData);
strData += "\r\n\t\t";
strData += "</exampleMessage>";
strData += "\r\n\t</soap:Body>";
strData += "\r\n</soap:Envelope>";
webservice是我用java在tomcat上写的一个exampleMessage接口,但是调用的时候没有放回自己要的数据?请教高手如何解决这个问题?
java的webservice接口是http://localhost:8080/HelloWorldService/services/HelloWorld.asmx,里面有一个接口是exampleMessage 接受一个string参数。
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
lijianli9
网络编程 18,356 成员 64,161 内容