asp调用webservice
来源:互联网 发布:淘宝男装分类 编辑:程序博客网 时间:2024/05/22 08:07
<%
'根据IP地址返回地理位置
dim objHTTP, xmlDOC, strWebserviceURL, strRequest, bOK, xmlStr
Set objHTTP = Server.CreateObject("MSXML2.XMLHTTP")
Set xmlDOC = Server.CreateObject("MSXML.DOMDocument")
strWebserviceURL = "http://webservice.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx/getCountryCityByIp" 'WebService的URL
strRequest = "theIpAddress=127.0.0.1" '带参数的方法调用
objHTTP.Open "POST", strWebserviceURL, False
objHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.Send(strRequest)
bOK = xmlDOC.load(objHTTP.responseXML)
if objHTTP.Status=200 then
xmlStr = xmlDOC.text 'xmlDOC.text返回text格式 xmlDOC.xml返回xml文件格式
Response.Write xmlStr
else
Response.Write objHTTP.Status&"<br>"
Response.Write objHTTP.StatusText
end if
%>
'根据IP地址返回地理位置
dim objHTTP, xmlDOC, strWebserviceURL, strRequest, bOK, xmlStr
Set objHTTP = Server.CreateObject("MSXML2.XMLHTTP")
Set xmlDOC = Server.CreateObject("MSXML.DOMDocument")
strWebserviceURL = "http://webservice.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx/getCountryCityByIp" 'WebService的URL
strRequest = "theIpAddress=127.0.0.1" '带参数的方法调用
objHTTP.Open "POST", strWebserviceURL, False
objHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.Send(strRequest)
bOK = xmlDOC.load(objHTTP.responseXML)
if objHTTP.Status=200 then
xmlStr = xmlDOC.text 'xmlDOC.text返回text格式 xmlDOC.xml返回xml文件格式
Response.Write xmlStr
else
Response.Write objHTTP.Status&"<br>"
Response.Write objHTTP.StatusText
end if
%>
- ASP调用WEBSERVICE文档
- ASP调用WEBSERVICE文档
- ASP调用.net webservice
- ASP调用WEBSERVICE文档
- asp.net调用WebService
- ASP调用WEBSERVICE文档
- Asp.net调用webservice
- Asp调用WebService
- Asp.net调用webservice
- Asp 调用WebService示例
- ASP调用WEBSERVICE文档
- asp调用webservice
- ASP调用WEBSERVICE文档
- asp.net异步调用webService
- ASP通过SOAP调用WebService
- asp.net如何调用 webservice
- asp.net Js调用 WebService
- asp.net webservice 调用实例
- 优化统一程序风格
- 【(动画版)解析三层架构】你可以不知道,你不能不知道!
- 几种地图定位方法
- ImageView 圆环旋转
- 方便快捷的布局法——利用960GS框架
- asp调用webservice
- 设计模式C++学习笔记之三(Singleton单例模式)
- LESS详解之命名空间
- 二叉树
- C#中get与set(类的属性封装)
- ALSA SOC在Linux3.1上的一些改进
- IIS默认网站被删除
- hadoop配置参数说明
- Oracle之课程实验一(安装oracle)