110,499
社区成员
发帖
与我相关
我的任务
分享
string requestHeader = null;
string requestBody = null;
requestHeader = "POST /WebServices/WeatherWebService.asmx HTTP/1.1\r\n"
+ "Host: www.webxml.com.cn\r\n"
+ "Content-Type: text/xml; charset=utf-8\r\n"
+ "Content-Length: " + requestBody.Length + "\r\n"
+ "SOAPAction: \"http://WebXml.com.cn/getWeatherbyCityName\"\r\n"
+ "Connection: Close\r\n\r\n";
requestBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\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/\">\r\n"
+ " <soap:Body>\r\n"
+ " <getWeatherbyCityName xmlns=\"http://WebXml.com.cn/\">\r\n"
+ " <theCityName>" + areaCode + "</theCityName>\r\n"
+ " </getWeatherbyCityName>\r\n"
+ " </soap:Body>\r\n"
+ "</soap:Envelope>";
string request = requestHeader + requestBody;
_rcv_buff = "";
_proxy.Send(_remoteHost, _remotePort, request);
// .....