Use Windows script to access Web Services

xiaoxiao2021-03-06  83

'' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' Modiay By X '2003-12-30' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ' '' 'Const forreading = 1, forwriting = 2, FORWRITING = 8' file operation constant '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' 'WebServiceURL = "http://www.chefbj.net/webservices/school.asmx" call URL (URI) WebMethodName = "http: // www .chefbj.com / show_school "'call method name

'SOAP request, you need to change SentRequest = "" _ & " "_ &" "_ &" "_ &" Chef "_ & "" _ & "" _ "" responsefile = "request.xml" answer file '' '' '' '' '' ' '' '' '' '' '' '' '' '' '' '' '' '' '' '

Set requestHttp = creteObject ("Microsoft.xmlhttp")

Requesthttp.open "Post", WebServiceURL, FALSE

Requesthttp.SetRequestHeader "Content-Type", "Text / XML" Requesthtp.SetRequestHeader "Charset", "UTF-8" Requestttp.SetRequestHeader "soapaction", webmedname

Requesthttp.send SentRequest

MsgBox ("request has been sent. Http request status =" & recommended http.status)

'Put the response to file set objfso = createObject ("scripting.filesystemObject") set objtextfile = objfso.createtextfile (responsefile, true, true)

ObjtextFile.write (Requesthttp.Responsexml.xml)

ObjtextFile.Close

转载请注明原文地址:https://www.9cbs.com/read-106221.html

New Post(0)