ASP调用.net webservice
来源:互联网 发布:js数组排序方法速度 编辑:程序博客网 时间:2024/06/08 01:51
<%
url = ".asmx" '方法地址
SoapRequest="<?xml version="&CHR(34)&"1.0"&CHR(34)&" encoding="&CHR(34)&"utf-8"&CHR(34)&"?>"& _
"<soap:Envelope xmlns:xsi="&CHR(34)&"http://www.w3.org/2001/XMLSchema-instance"&CHR(34)&" "& _
"xmlns:xsd="&CHR(34)&"http://www.w3.org/2001/XMLSchema"&CHR(34)&" "& _
"xmlns:soap="&CHR(34)&"http://schemas.xmlsoap.org/soap/envelope/"&CHR(34)&">"& _
"<soap:Body>"& _
"<LoginByAccount xmlns="&CHR(34)&"http://tempuri.org/"&CHR(34)&">"& _
"<username>"&username&"</username>"& _
"<password>"&password&"</password>"& _
"</LoginByAccount>"& _
"</soap:Body>"& _
"</soap:Envelope>"
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open "POST",url,false
xmlhttp.setRequestHeader "Content-Type", "text/xml;charset=utf-8"
xmlhttp.setRequestHeader "HOST","61.152.114.247"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "http://tempuri.org/RetrievingSpecialServerStatusStr" '一定要与WEBSERVICE的命名空间相同,否则服务会拒绝
xmlhttp.Send(SoapRequest)
'这样就利用XMLHTTP成功发送了与SOAP示例所符的SOAP请求.
'检测一下是否成功:
Response.Write xmlhttp.Status&" "
Response.Write xmlhttp.StatusText
If xmlhttp.Status = 200 Then
Set xmlDOC =server.CreateObject("MSXML.DOMDocument")
xmlDOC.load(xmlhttp.responseXML)
xmlStr = xmlDOC.xml
Set xmlDOC=nothing
xmlStr = Replace(xmlStr,"<","<")
xmlStr = Replace(xmlStr,">",">")
Response.write xmlStr
Else
Response.Write xmlhttp.Status&" "
'Response.Write xmlhttp.StatusText
End if
If xmlhttp.Status = 200 Then
Set xmlDOC = server.CreateObject("MSXML.DOMDocument")
xmlDOC.load(xmlhttp.responseXML)
Response.Write xmlDOC.documentElement.selectNodes("//RetrievingSpecialServerStatusStrResult")(0).text '显示节点为RetrievingSpecialServerStatusStrResult的数据(有编码则要解码)
Set xmlDOC = nothing
Else
Response.Write xmlhttp.Status&" "
Response.Write xmlhttp.StatusText
End if
Set xmlhttp = Nothing
%>
- ASP调用.net webservice
- asp.net调用WebService
- Asp.net调用webservice
- Asp.net调用webservice
- asp.net异步调用webService
- asp.net如何调用 webservice
- asp.net Js调用 WebService
- asp.net webservice 调用实例
- asp.net动态调用webservice
- ASP.NET中调用WebService
- asp.net webservice 调用实例
- asp.net webservice 调用实例
- ASP.NET WebService+Ajax调用
- ASP如何调用。Net的WebService
- asp.net中的WebService 跨平台调用
- EXT调用ASP.NET AJAX WebService
- EXT调用ASP.NET AJAX WebService
- EXT调用ASP.NET AJAX WebService
- 在C#中利用ActiveX控件进行视频采集
- ASP部份常用函数
- IBM:Peggy:SOA重在把业务变成组件和流程化模块
- 美科利推出面向服务架构(SOA)的业务优化科技
- Sun Java System Application Server 9 & DB2,Hiberante3,SUSE Linux Server9
- ASP调用.net webservice
- 由數組比較引出的“等于”問題
- 招聘乐事
- Calculator.NET 2.3发布
- Javascript:检测FlashPlayer版本的函数
- 关于VS2005中的Code Snippets Manager的问题及解决
- aspnetdb.mdf数据字典
- [翻译]脚本引擎实现 - 第四部分 符号表和文法树
- [winform入门级好书]c# Windows Forms程序设计