欢迎光临
我们一直在努力

使用WINDOWS脚本访问WEB SERVICES-.NET教程,Web Service开发

建站超值云服务器,限时71元/月

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="<?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>"_

& "<show_school xmlns=http://www.chefbj.com>"_

& "<password>chef</password>"_

& "</show_school>"_

& "</soap:body>"_

& "</soap:envelope>"

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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 使用WINDOWS脚本访问WEB SERVICES-.NET教程,Web Service开发
分享到: 更多 (0)

相关推荐

  • 暂无文章