views:

14

answers:

0

Hi Guys

I'm trying to Post Data to a Web Service, from ASP (VBScript), using the CreateObject("Microsoft.XMLHTTP"). Trick is, I am able to post the Web Service if it resides on the same server. But the moment I post the web service from a remote server or different server, I assume its as if the post data never got sent.

Below is an example of the function I use to post the webservice. Keep in mind it works on the local server, but not on any remote servers.

   Function HttpPostData2(sUrl, sRequest, Data)

set oHTTP = CreateObject("Microsoft.XMLHTTP")
oHTTP.open "post", sUrl & sRequest , false oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHTTP.send Data HttpPostData2 = oHTTP.responseText End Function

url = APIurl & "MyQuery"

Response.Write(url & "
")

params = APIKey & "MyParameter=657407"

Response.Write(params & "
")

result = HttpPostData2(url, null, params) Response.Write(result)