...

View Full Version : Help with MSXML2.ServerXMLHTTP



Basscyst
09-27-2005, 09:52 PM
Currently when a customer wants to sign-up with the company I work for, there is a site an administrator goes to, to check to see if they show up on a certain report. I was able to automate this process for another site we use and it works beautifully. Unfortunatley, this site I'm trying to do it with now doesn't seem to want to cooperate. It just comes back as a blank page.

This is the form I'm trying to access:

http://epls.arnet.gov/epls/servlet/EPLSSearchMain/2

This is the code I am using to post to the page that form posts to:



<%
Dim oXMLHTTP, sResponse
Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oXMLHTTP.Open "POST", "http://epls.arnet.gov/epls/servlet/EPLSGetInputSearch", False
oXMLHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHTTP.Send "" & _
"option=2"&_
"button=OK"&_
"name1=adams"&_
"pen=ANY" &_
"f=sc"

sResponse = oXMLHTTP.ResponseText
sOriginalResponse = sResponse
Set oXMLHTTP = Nothing
response.write(sOriginalResponse)
%>


First off is there anything wrong with doing this? It worked like a charm for the other site they use for customer verification. Secondly, why isn't this working. I'm guessing it has something to do with the submit button having to be actually clicked, but I'm passing it too. :confused:

Thanks,
Basscyst

glenngv
09-28-2005, 01:36 PM
You don't have the ampersand to separate form data.


oXMLHTTP.Send "" & _
"option=2&" &_
"button=OK&" &_
"name1=adams&" &_
"pen=ANY&" &_
"f=sc"
You might have been confused with the & operator.

Basscyst
09-28-2005, 05:31 PM
Yep, I ended up figuring it out, that was exactly the problem. I also needed to specify the length of the form string as well.



oXMLHttp.setRequestHeader "Content-Length", Len(sQuery)


Thanks,
Basscyst



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum