Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

Post new topic   Reply to topic Posted in: Widget Development

Problems with debugging XMLHttpRequest

Author Message
spross



Joined: 04 Nov 2006
Posts: 4

Posted: Sat Nov 04, 2006 - 11:44 am    Post subject: Problems with debugging XMLHttpRequest Reply with quote

i'm coding a widget for aspsms. to send a sms, i have to send them an xml 'file'.

that's my code:

Code:
      xmlhttp = new XMLHttpRequest();
      xmlhttp.open("POST", "http://xml1.aspsms.com:5061/", true);
      xmlhttp.onreadystatechange=function() {
         alert(xmlhttp.responseText)
      }
       
       var xmltext = "<?xml version='1.0' encoding='ISO-8859-1'?>" +
         "<aspsms>" +
            "<Userkey>" + login + "</Userkey>" +
            "<Password>" + passwd + "</Password>" +
            "<Originator>" + origin + "</Originator>" +
            "<Recipient>" +
               "<PhoneNumber>" + to + "</PhoneNumber>" +
            "</Recipient>" +
            "<MessageData>" + msg_part + "</MessageData>" +
            "<Action>SendTextSMS</Action>" +
         "</aspsms>";
       
      xmlhttp.setRequestHeader("Man", "POST /xmlsvr.asp HTTP/1.0");
      xmlhttp.setRequestHeader("Content-Type", "text/xml");
      xmlhttp.setRequestHeader("Content-Length", xmltext.length);
      xmlhttp.send(xmltext);
      alert(xmlhttp.readyState);
      alert(xmlhttp.status);
      alert(xmlhttp.statusText);
      alert(xmlhttp.responseXML);
      alert(xmlhttp.responseText);


it doesn't work. but i can't find the fault, because no answers comes back:

Quote:
2006-11-04 17:38:13.260 DashboardClient[1841] ch.sisprocom.widgets.aspsms: null

2006-11-04 17:38:13.261 DashboardClient[1841] ch.sisprocom.widgets.aspsms: 4

2006-11-04 17:38:13.261 DashboardClient[1841] ch.sisprocom.widgets.aspsms: undefined

2006-11-04 17:38:13.261 DashboardClient[1841] ch.sisprocom.widgets.aspsms: undefined

2006-11-04 17:38:13.262 DashboardClient[1841] ch.sisprocom.widgets.aspsms: [object Document]

2006-11-04 17:38:13.262 DashboardClient[1841] ch.sisprocom.widgets.aspsms: null


how can i debugg? can somebody help me?
other examples for sending sms over asp you can find here: http://www.aspsms.com/examples/home.asp

thanks!
spross
View user's profile Send private message Send e-mail Widgets
Powerphillg5



Joined: 17 Oct 2006
Posts: 5

Posted: Sat Nov 04, 2006 - 2:16 pm    Post subject: Hello Reply with quote

in your info plist make sure you have: (Property)AllowNetworkAccess -----(class) Boolean---(value)yes
View user's profile Send private message Send e-mail Widgets
spross



Joined: 04 Nov 2006
Posts: 4

Posted: Mon Nov 06, 2006 - 5:27 am    Post subject: Re: Hello Reply with quote

Powerphillg5 wrote:
in your info plist make sure you have: (Property)AllowNetworkAccess -----(class) Boolean---(value)yes

thx Smile i wrote Nework Smile
View user's profile Send private message Send e-mail Widgets
mnieto



Joined: 05 Apr 2006
Posts: 7

Posted: Wed Nov 08, 2006 - 5:40 am    Post subject: Reply with quote

Hi spross, can you explain me this line in your code?

xmlhttp.setRequestHeader("Man", "POST /xmlsvr.asp HTTP/1.0");


I am trying to make a request with SOAP and I have some problems. I do not understand what´s wrong.


Does any one know a site where examples about xmlhttprequest with SOAP files are?



Thank you for your help.
View user's profile Send private message Send e-mail Widgets
spross



Joined: 04 Nov 2006
Posts: 4

Posted: Wed Nov 15, 2006 - 7:49 am    Post subject: Reply with quote

hi

that's an old version... now it looks like this:

Code:
      xmlhttp = new XMLHttpRequest();
      xmlhttp.open("POST", "http://xml1.aspsms.com:5061/xmlsvr.asp", false);
       
      var xmltext = "<?xml version='1.0' encoding='ISO-8859-1'?>...";
       
      xmlhttp.setRequestHeader("Content-Type", "text/xml");
      xmlhttp.send(xmltext);


Sry, it's my first use of XMLHttpRequest too and i don't know anything about SOAP Sad
View user's profile Send private message Send e-mail Widgets
Post new topic   Reply to topic

 
Powered by phpBB © 2001, 2002 phpBB Group