Send OTA from application

Send OTA from application SearchSearch
Author Message
Lol
New member
Username: Lol

Post Number: 2
Registered: 11-2008
Posted on Thursday, November 13, 2008 - 12:39 pm:   

Hi Des,

I'm having some problems when i try to submit a OTA Settings using the Webservice

I was hoping you could tell me what i'm doing wrong ??
Do i need to se the content-type to multidata and create a mime-content ?

This is the 2 compinations i tried to send

--- The First one ---

POST /?OTA=POST&User=sms&Password=smsPWD&phonenumber=%2B4528261665&Sender=1234 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length:: 903
User-Agent: Java/1.5.0_16
Host: 172.16.15.126:8800
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 903

%3C%3Fxml+version%3D%221.0%22%3F%3E%0D%0A%3CCHARACTERISTIC-LIST%3E%0D%0A%09%3CCH ARACTERISTIC+TYPE%3D%22ADDRESS%22%3E%0D%0A%09%09%3CPARM+NAME%3D%22BEARER%22+VALU E%3D%22GPRS%22%2F%3E%0D%0A%09%09%3CPARM+NAME%3D%22PROXY%22+VALUE%3D%220.0.0.0%22 %2F%3E%0D%0A%09%09%3CPARM+NAME%3D%22GPRS_ACCESSPOINTNAME%22+VALUE%3D%22internet% 22%2F%3E%0D%0A%09%09%3CPARM+NAME%3D%22PPP_AUTHTYPE%22+VALUE%3D%22PAP%22%2F%3E%0D %0A%09%09%3CPARM+NAME%3D%22PPP_LOGINTYPE%22+VALUE%3D%22AUTOMATIC%22%2F%3E%0D%0A% 09%09%3CPARM+NAME%3D%22PPP_AUTHNAME%22+VALUE%3D%22%22%2F%3E%0D%0A%09%09%3CPARM+N AME%3D%22PPP_AUTHSECRET%22+VALUE%3D%22%22%2F%3E%0D%0A++++++++%3C%2FCHARACTERISTI C%3E%0D%0A%0D%0A%09%3CCHARACTERISTIC+TYPE%3D%22URL%22+VALUE%3D%22%22%2F%3E%0D%0A %0D%0A%09%3CCHARACTERISTIC+TYPE%3D%22NAME%22%3E%0D%0A%09%09%3CPARM+NAME%3D%22NAM E%22+VALUE%3D%22TDC+Internet%22%2F%3E%0D%0A%09%3C%2FCHARACTERISTIC%3E%0D%0A%3C%2 FCHARACTERISTIC-LIST%3E

--- the second one ---

POST /?OTA=POST&User=sms&Password=smsPWD&phonenumber=+4528261665&Sender=1234 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length:: 903
User-Agent: Java/1.5.0_16
Host: 172.16.15.126:8800
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 903

<?xml version="1.0"?>
<CHARACTERISTIC-LIST>
<CHARACTERISTIC TYPE="ADDRESS">
<PARM NAME="BEARER" VALUE="GPRS"/>
<PARM NAME="PROXY" VALUE="0.0.0.0"/>
<PARM NAME="GPRS_ACCESSPOINTNAME" VALUE="internet"/>
<PARM NAME="PPP_AUTHTYPE" VALUE="PAP"/>
<PARM NAME="PPP_LOGINTYPE" VALUE="AUTOMATIC"/>
<PARM NAME="PPP_AUTHNAME" VALUE=""/>
<PARM NAME="PPP_AUTHSECRET" VALUE=""/>
</CHARACTERISTIC>
<CHARACTERISTIC TYPE="URL" VALUE=""/>
<CHARACTERISTIC TYPE="NAME">
<PARM NAME="NAME" VALUE="TDC Internet"/>
</CHARACTERISTIC>
</CHARACTERISTIC-LIST>

the Weblog says:

2008-10-01 13:20:44,127.0.0.1,sms,48DCA537.req,WAPOTA
2008-10-01 13:20:59,127.0.0.1,sms,48DCA539.req,WAPOTA

The smsout log

2008-10-01 13:19:25,48DCA535.req,127.0.0.1,28261665,OK -- COM3:,SubmitUser=sms;Sender=1234;Binary=1;DCS=F5;UDH=060504C34FC002;Data=A8062C1 F2A6170706C69636174696F6E2F782D7761702D70726F762E62726F777365722D73657474696E677 30081EA01016A0045C606018712490187131103302E302E302E300001871C1103696E7465726E657 4000187227001871D640187231101872411010186071101C608018715110354444320496E7465726 E657400010101
2008-10-01 13:21:06,48DCA539.req,127.0.0.1,28261665,OK -- COM3:,SubmitUser=sms;Binary=1;DCS=F5;UDH=060504C34FC002;Data=AA062C1F2A6170706C6 9636174696F6E2F782D7761702D70726F762E62726F777365722D73657474696E67730081EA01016 A0045C606018712490187131103302E302E302E300001871C1103696E7465726E657400018722700 1871D640187231101872411010186071101C608018715110354444320496E7465726E65740001010 1

Best regards,

lol
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7687
Registered: 10-2002
Posted on Friday, November 14, 2008 - 12:35 am:   

Hi,


From the log, I'd say that it looks like it worked to me. At least the web log recognized it as an OTA request, and seems to have encoded it as one.

From the examples below ... the first one is NOT going to work. NowSMS does not do any URL unescaping of OTA content.

The second one looks right ... sort of. While the XML data is not URL escaped, the phone number in the URL string does need to be URL escaped (%2B
instead of +). The "Content-type:" parameter will be ignored. Technically it should be something like "application/xml" to avoid any confusion.

If the browser is not recognizing the settings, that is a different issue. Experiment sending them via the web interface first ... so that you know whether the problem is in the settings or the way they are being posted. A proxy value of "0.0.0.0" is likely to not be understood by most browsers. I assume that the user is trying to send browser settings without a proxy. We've seen at least 3 different ways that this needs to be done for different phone models, as different manufacturers have interpreted the specs in different ways. The NowSMS readme file has some details about this, and you can use the "View XML" option in the NowSMS web interface to see the different XML we generate under different circumstances. The note in the readme file that I am referring to is under the header 2006-08-24.


quote:

* OMA OTA: Add support for connection settings without a proxy for newer SonyEricsson and Motorola phones. For most phones, leaving the "Proxy Settings Section" of the OMA OTA web form blank will allow you to define connection settings without a proxy. However, SonyEricsson and Motorola do not support the TO-NAPID parameter for browser or MMS settings. To send connection settings without a proxy to these phones, use (blank), literal text including the parentheses, as the "WAP Proxy IP Address" value, which will enable a work-around for these phones. For Motorola phones, you must set the "WAP Proxy Port & Connection Type" to "Other" and "8080" (other values might also work) ... but for SonyEricsson phones, this setting should be left at its default value.




The bit about (blank) in the above text always confuses people. It means to actually put the text (blank) in the "WAP Proxy IP Address" field of the form, including the parentheses around the word blank. This is a special trigger for NowSMS to generate the XML for settings without a proxy in a format that SonyEricsson and Motorola phones support.

If you leave the "WAP Proxy IP Address" field blank, then it generates settings without a proxy in the standard format, which is what Nokia (and most other) phones expect.

You can use the "View XML" button to see the differences if you need to do some of your own customisations for posting the XML from your own application.

-bn