Solved

Problem posting form data to URL with XMLHTTP

Posted on 2006-11-22
8
1,292 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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/…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 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