当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > Script:使用WINDOWS脚本访问WEB SERVICES

ASP.NET
关于数据绑定在Web页面呈现效果的一点小技巧
菜鸟模仿duwamish开发时常见的错误
基于.net的快速开发思想
ASP.Net实现将Word转换PDF格式
用ASP.NET建立一个在线RSS新闻聚合器
ASP.NET图象处理详解
名称地址(Namespace)
Win中Net命令的另类用法
浅析.Net下的多线程编程
构造.NET环境下的网页下载器 (1)
构造.NET环境下的网页下载器 (2)
ASP.NET编程中的十大技巧(上)
ASP.NET编程中的十大技巧(下)
C# 3.0语言详解之基本的语言增强
Windows.NET Server: XML Web 服务
ASP.Net中程序构架与程序代码的分离
.NET 数据访问架构指南
用Visual C#打造多页面网页浏览器
.NET 2.0 基础类库中的范型:范型集合
.NETCompactFramework的使用技巧

ASP.NET 中的 Script:使用WINDOWS脚本访问WEB SERVICES


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 107 ::
收藏到网摘: n/a


'''''''''''''''''''''''''''''''''''''''''''''''
'Modiay by X
' 2003-12-30
'''''''''''''''''''''''''''''''''''''''''''''''
Const ForReading = 1, ForWriting = 2, ForAppending = 8 '文件操作常量
'''''''''''''''''''''''''''''''''''''''''''''''
WebServiceURL = "http://www.chefbj.net/WEBSERVICES/school.asmx" '调用URL(URI)
WebMethodName = "http://www.chefbj.com/show_school" '调用方法名
'soap请求,需要根据具体WEB SERVICES web方法更改
sentRequest=""_
& "& "xmlns:xsd='http://www.w3.org/2001/XMLSchema' "_
& "xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"_
& ""_
& ""_
& "
chef
"_
& "
"_
& "
"_
& "
"
responsefile="request.xml" '应答文件
'''''''''''''''''''''''''''''''''''''''''''''''

Set requestHTTP = CreateObject("Microsoft.XMLHTTP")
requestHTTP.open "POST", WebServiceURL, false
requestHTTP.setrequestheader "Content-Type", "text/xml"
requestHTTP.setrequestheader "charset", "utf-8"
requestHTTP.setrequestheader "SOAPAction", WebMethodName
requestHTTP.Send sentRequest
MsgBox("请求已经送出. HTTP request status= " & requestHTTP.status)

'将应答记录入文件
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(responsefile, True,true)objTextFile.Write(requestHTTP.responsexml.xml)objTextFile.Close