What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [help!] XML HTTP

[help!] XML HTTP
Author: Message:
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
33 / Male / Flag
Joined: Apr 2006
O.P. [help!] XML HTTP
Hello!

I am writing a script to upload a message to stikkit. I have used the following code, but the script debugging window always says that "access is denied" on line 24 when the code is executed.

code:
function Stikk(note)
{
    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
    xmlHttp.open("POST", "http://api.stikkit.com/stikkits.atom", false);
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    Debug.Trace("raw_text="+note+"&apikey="+APIKey);
    xmlHttp.send("raw_text="+note+"&apikey="+APIKey); <-- Line 24

    MsgPlus.DisplayToastContact("Stikkit Live!","[c=46]Stukk[/c]\n", note);
}

Any help would be much appreciated!

Thanks

Robert
08-22-2007 02:15 PM
Profile E-Mail PM Web Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: [help!] XML HTTP
try not using a specific version of msxml but just use "MICROSOFT.XMLHTTP", that will let windows choose the newest version it has installed.

That might solve it.
[Image: 1-0.png]
             
08-22-2007 02:43 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: [help!] XML HTTP
First of all, use "Microsoft.XMLHTTP" instead of "Msxml2.XMLHTTP.3.0". It's strongly recommended that you try not to use version numbers in ActiveXObject references, and with "Microsoft.XMLHTTP" you're guaranteed that it'll always use the latest version.

Secondly, where did you define APIKey?

Apart from these remarks, I don't see the problem... :-S

EDIT: Blah, Ezra beat me. :P

This post was edited on 08-22-2007 at 02:46 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-22-2007 02:45 PM
Profile E-Mail PM Web Find Quote Report
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
33 / Male / Flag
Joined: Apr 2006
O.P. RE: [help!] XML HTTP
Thank you, but I'm afraid it doesn't solve the problem. I still get the following error message in the debug console:

code:
Error: Access is denied.
(code: -2147024891)
       File: Stikkit Live!.js. Line: 24.


EDIT: APIKey is defined outside of any functions. It is correctly inserted into the debugging line directly above the problem line. One thought, do I need to define a connection to the internet?

This post was edited on 08-22-2007 at 02:47 PM by rob_botch.
08-22-2007 02:45 PM
Profile E-Mail PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [help!] XML HTTP
http://api.stikkit.com/stikkits.atom requires login. Without that you won't be able to access the url. Use something like http://user:password@api.stikkit.com/stikkits.atom that'd work i guess. Access Denied is maybe some 403 error.

Btw also try setting Request Headers, might work [Image: msn_happy.gif].

This post was edited on 08-22-2007 at 04:43 PM by Felu.
08-22-2007 04:42 PM
Profile E-Mail PM Web Find Quote Report
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
33 / Male / Flag
Joined: Apr 2006
O.P. RE: [help!] XML HTTP
Thanks everybody for the pointers. Actually, I've just discovered and solved the problem. It was my own stupidity which caused the problem: apikey is actually api_key. If only JScript had stikkit's levels of free text compatability... :P
08-22-2007 04:48 PM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: [help!] XML HTTP
I got this message when I was developing a script and it turned out to be because I was using a query string with more than one variable in it...
<Eljay> "Problems encountered: shit blew up" :zippy:
08-22-2007 08:30 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On