Solved

Problem posting form data to URL with XMLHTTP

Posted on 2006-11-22
8
1,273 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
Comment Utility
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
Comment Utility
If that was the case then why would the data be sent anyway?
0
 
LVL 58

Expert Comment

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

set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 2

Author Comment

by:digital_soul
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed with no points refunded (of 125)

Computer101
EE Admin
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

9 Experts available now in Live!

Get 1:1 Help Now