File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Retrieving response sent by the sms service? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Retrieving response sent by the sms service?" Watch "Retrieving response sent by the sms service?" New topic
Author

Retrieving response sent by the sms service?

Lila Fowler
Ranch Hand

Joined: Jul 31, 2009
Posts: 84
Hi all,

I am sending a sms via Clickatell using the HttpURLConnection method in java.
Although the message sends fine, I cannot seem to get the message returned by Clickatell.

The way it works without java is I paste the url into the browser and on the browser window
either a message id appears or an error message appears. (I have included screen shots of both.)

I am looking for a way to retrieve the error/success message that clickatell returns in the screen shots.

Here is the main snippet of the current code:



I have tried get and post but this simply returned a null value.
Either I am using these methods wrong, or because the actual
URL does not change the to include the value, the value cannot
be picked up by these methods.

Any ideas what I need to do differently or how to get the results?

Thanks for the help.



[Thumbnail for clickatellmessageid.jpg]


[Thumbnail for clickatellerrormessage.jpg]



Courage is not the absence of fear but rather the judgment that something is more important then fear. ~ Ambrose Redmond
Lila Fowler
Ranch Hand

Joined: Jul 31, 2009
Posts: 84
Thanks guys,

Managed to sort it out using an Input Stream instead

Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 118

Exactly, you were missing reading of response in your code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieving response sent by the sms service?
 
Similar Threads
Reading Cookies from HttpUrlConnection - Set-Cookie Header
to send sms.
Fetch Data from URL
HttpsURLConnection ClassCastException Question
setrequestheader() - User-Agent - no good?