Dim objDom As Object
Dim objXmlHttp As Object
Dim strRet As String
Dim AsmxUrl As String
Dim SoapActionUrl As String
Dim XmlBody As String
SoapActionUrl = "http://tempuri.org/CalcDist"
XmlBody = "..soap:Envelope..."
AsmxUrl = "http://host/Service1.asmx"
' Create objects to DOMDocument and XMLHTTP
Set objDom = CreateObject("MSXML2.DOMDocument")
Set objXmlHttp = CreateObject("MSXML2.XMLHTTP")
' Load XML
objDom.async = False
objDom.loadXML XmlBody
' Open the webservice
objXmlHttp.Open "POST", AsmxUrl, False
' Create headings
objXmlHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objXmlHttp.setRequestHeader "SOAPAction", SoapActionUrl
' Send XML command
objXmlHttp.send objDom.xml
' Get all response text from webservice
strRet = objXmlHttp.responseText
' Close object
Set objXmlHttp = Nothing
No comments:
Post a Comment