vc调用webservice步骤:
arrayofsting getWeatherbyCityName(string cityname)函数原型
1:#import <C:/WINDOWS/system32/msxml3.dll>
using namespace MSSOAPLib30;
2:在浏览器中输入webservice地址打开会有类似:
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。
POST /WebServices/WeatherWebService.asmx HTTP/1.1 Host: www.webxml.com.cn Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://WebXml.com.cn/getWeatherbyCityName" <?xml version="1.0" encoding="utf-8"?> <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/"> <soap:Body> <getWeatherbyCityName xmlns="http://WebXml.com.cn/"> <theCityName>string</theCityName> </getWea

本文档详细介绍了如何使用VC调用WebService获取天气预报的步骤,包括导入msxml3.dll库,设置SOAP请求,连接并发送请求,解析返回的XML数据,并从中提取天气信息。

2139

被折叠的 条评论
为什么被折叠?



