?
Solved

Problem posting form data to URL with XMLHTTP

Posted on 2006-11-22
8
Medium Priority
?
1,295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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/…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 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