Sending Text Message programatically

Sending Text Message programatically SearchSearch
Author Message
Sachin Dere
New member
Username: Mark

Post Number: 1
Registered: 09-2004
Posted on Tuesday, September 14, 2004 - 07:52 am:   

Hi guys,
I have developed a small Java Program which opens a URL Connection to NowSMS gateway installed in our company. But it cannot send the text message to my phone. what am i doing wrong? the same URL works from a browser.But we have to develop a Java program which will connect to NowSMS gateway and not through Browser. How can i do this?
thanks in advance
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3429
Registered: 10-2002
Posted on Tuesday, September 14, 2004 - 06:17 pm:   

Hi,

Let's take a closer look at the URL that you are generating. My guess is that it has something to do with URL-escaping of the parameters.

For example, one common issue is that if you include the international "+" sign in a phone number, in an actual URL request, it needs to be encoded as "%2B" (whereas a browser will often do that conversion for you).

My advice would be to enable the debug log in NowSMS. Edit SMSGW.INI, and add Debug=Yes under the [SMSGW] section header. Restart the SMS gateway service.

Then, make a URL request to send a message from a browser ... followed by a request from your application.

NowSMS will log the received URL in the SMSDEBUG.LOG. Compare the two requests, and hopefully that will provide the missing clue.

-bn
Sachin Dere
New member
Username: Mark

Post Number: 2
Registered: 09-2004
Posted on Thursday, September 16, 2004 - 03:04 am:   

Hi Bruce,
ur absolutely right.Even though i am encoding the URL and substituting " " with + sign in my program,which looks like this PhoneNumber=0122042513&Text=Final+Testing+from+JavaApp,it doesnt work.But when i do the same thing in browser, it works. I will compare the two strings and will get back to u.
thanks for replying,
Sachin
Sachin Dere
New member
Username: Mark

Post Number: 3
Registered: 09-2004
Posted on Friday, September 17, 2004 - 05:06 am:   

Hi Bruce,
I compared the Log file and found out the problem by doing exactly as u said.thanks so much
cheers,
Sachin