Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts

    Help with MSXML2.ServerXMLHTTP

    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:

    Code:
    <%
    		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.

    Thanks,
    Basscyst
    Last edited by Basscyst; 09-27-2005 at 09:54 PM.
    Helping to build a bigger box. - Adam Matthews

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,964
    Thanks
    0
    Thanked 236 Times in 233 Posts
    You don't have the ampersand to separate form data.
    Code:
    oXMLHTTP.Send "" & _
      "option=2&" &_
      "button=OK&" &_
      "name1=adams&" &_
      "pen=ANY&" &_
      "f=sc"
    You might have been confused with the & operator.

  • #3
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    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.

    Code:
    oXMLHttp.setRequestHeader "Content-Length", Len(sQuery)
    Thanks,
    Basscyst
    Helping to build a bigger box. - Adam Matthews


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •