Solved

Problem posting form data to URL with XMLHTTP

Posted on 2006-11-22
8
1,276 Views
Last Modified: 2008-01-09
I have a short script that is attempting to send form data to an external URL via XMLHTTP to trigger an SMS message. Now when this is run the SMS message is received, so the data is clearly being sent however I get a msxml3.dll (0x80070005) Access is denied error on the xmlhttp.Send line which is baffling me.

set xmlhttp = Server.CreateObject("Msxml2.XMLHTTP")
            xmlhttp.Open "POST", "http://www.kapow.co.uk/scripts/sendsms.php", false
            xmlhttp.setRequestHeader "lastCached", now()
            xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlhttp.Send ("username=xxxx&password=xxx&mobile=" & mobileNum & "&sms=" & txtMsg & "&from_id=" & msgLabel & "&url=http://www.xxxx.co.uk/kapow/callback.asp")
            set xmlhttp = nothing
            status = "SMS sent - awaiting status report"
            smsSendInc = null
            checkStatus = false

Any help will be greatly appreciated.

Cheers
0
Comment
Question by:digital_soul
8 Comments
 
LVL 8

Expert Comment

by:esw074
ID: 17997377
Sounds like a permissions error.  Be sure that the "internet user account" (iusr) has permission to access the msxml3 DLL.
0
 
LVL 2

Author Comment

by:digital_soul
ID: 17997452
If that was the case then why would the data be sent anyway?
0
 
LVL 58

Expert Comment

by:amit_g
ID: 17997582
You are doing it from the asp right? If so use MSXML2.ServerXMLHTTP instead of Msxml2.XMLHTTP

set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Author Comment

by:digital_soul
ID: 18001781
Nope. Same problem with MSXML2.ServerXMLHTTP. The data is sent to the extrnal url, but still getting an error on the  xmlhttp.Send line.

How is it that that line is able to process (the data gets picked up at the other URL) and generate a permissions error as well? Is it throwing an exception to a response back from the POST send that I need to deal with??

Cheers
0
 
LVL 58

Expert Comment

by:amit_g
ID: 18004506
Since you have posted the URL that you are using, I could do my own testing and here is what is happening. The site where you post data gets the data successfully as you have already know. Your posted data has a parameter called URL. Using that the kapow.co.uk sends a 320 redirect header back. MSXML has a problem with that due the fact that the original domain and the redirected domain are different. You have 2 options. One - don't set the URL but then you won't get a callback and so you won't know but this would work, if you don't really care about calling callback.asp. Two - use WinHttp.WinHttpRequest.5.1 object instead of XMLHttp. Just change the progid from Msxml2.XMLHTTP to WinHttp.WinHttpRequest.5.1. Everything else remains same. Also there is another problem. kapow.co.uk is adding http:// to the URL so your request should not include it. So change

xmlhttp.Send ("username=xxxx&password=xxx&mobile=" & mobileNum & "&sms=" & txtMsg & "&from_id=" & msgLabel & "&url=http://www.xxxx.co.uk/kapow/callback.asp")

to

xmlhttp.Send ("username=xxxx&password=xxx&mobile=" & mobileNum & "&sms=" & txtMsg & "&from_id=" & msgLabel & "&url=www.xxxx.co.uk/kapow/callback.asp")
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18225336
PAQed with no points refunded (of 125)

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now