| Author |
Message |
spross
Joined: 04 Nov 2006 Posts: 4
|
| Posted: Sat Nov 04, 2006 - 11:44 am Post subject: Problems with debugging XMLHttpRequest |
|
|
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 |
|
| |
|
| |
Powerphillg5
Joined: 17 Oct 2006 Posts: 5
|
| Posted: Sat Nov 04, 2006 - 2:16 pm Post subject: Hello |
|
|
| in your info plist make sure you have: (Property)AllowNetworkAccess -----(class) Boolean---(value)yes |
|
| |
|
| |
spross
Joined: 04 Nov 2006 Posts: 4
|
| Posted: Mon Nov 06, 2006 - 5:27 am Post subject: Re: Hello |
|
|
| Powerphillg5 wrote: | | in your info plist make sure you have: (Property)AllowNetworkAccess -----(class) Boolean---(value)yes |
thx i wrote Nework  |
|
| |
|
| |
mnieto
Joined: 05 Apr 2006 Posts: 7
|
| Posted: Wed Nov 08, 2006 - 5:40 am Post subject: |
|
|
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. |
|
| |
|
| |
spross
Joined: 04 Nov 2006 Posts: 4
|
| Posted: Wed Nov 15, 2006 - 7:49 am Post subject: |
|
|
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  |
|
| |
|
| |