Hi Mani,
You will need to edit this code to meet your requirements but it should act as a good starting point. I have used this in the past to query a web service and return a response (this will be set to HTTPPost).
You may also need to write an additional function to handle the response you get back depending on what your service is returning. Also note that HTTPPost uses a POST request, if you need to perform a GET then just change this value in the function (I have not tried this myself so can't say for sure if it'll work).
Sub QueryWebService
Dim postURL, strQueryString, httpResponse
postURL = "http://localhost:1229/Token.asmx"
strQueryString = "op=Add"
Set httpResponse = HTTPPost(postURL, strQueryString)
End Sub
Function HTTPPost(sUrl, sRequest)
Dim oHTTP
set oHTTP = CreateObject("Microsoft.XMLHTTP")
oHTTP.open "POST", sUrl,false
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHTTP.setRequestHeader "Content-Length", Len(sRequest)
oHTTP.send sRequest
HTTPPost = oHTTP.responseText
End Function
Hope this helps.
Lee |