Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Mobile-Applications SMS gateway for Java developer
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


rahul c
SMS gateway for Java developer
2 Answer(s)      6 years and 10 months ago
Posted in : MobileApplications


SMS API for JAVA developers


Advertisement
View Answers

February 23, 2008 at 9:18 AM


Hi,
SMS API for JAVA developers

The following example gives you detailed instructions on how you can send a WAP Push SMS messages from Java. The example uses HTTP Client functionality to pass the outgoing messages to the built in HTTP server of Ozeki Message Server. In the example we assume, that Ozeki Message Server is already installed and configured. A WAP push message contains a description of a WAP page and an URL that points to it.

Ozeki Message server can also be used to send text messages and various binary SMSes such as vCard and vCalendar messages, Operator Logos and Ringtones. All you have to do is change the messageType field and the message content in this example. A list of supported message types can be found on the following URL: http://www.ozeki.hu/index.php?owpn=488.

To send a WAP push message we use the HTTP client library of Apache.org. First you need to download this library:

Step 1. - download the apache HTTP client library

Go to the following webpage: http://apache.4any.org/httpcomponents/commons-httpclient/source/commons-httpclient-3.1-src.zip, and download version 3.1.

After you have downloaded the file (commons-httpclient-3.1-src.zip) unzip it! The unzip will create the following jar file, that contains the HTTP client utilities: commons-httpclient-3.1.jar

Setp 2 - set the CLASSPATH to have access to the functions stored in this jar.

SET CLASSPATH=C:/tmp/commons-httpclient-3.1/commons-httpclient-3.1.jar

Step 3 - create a .java source file, that will connect to Ozeki Message Server and will post a message.

PostExample.java

import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;

public class PostExample {
public static void main( String[] args ) {
String url = "http://127.0.0.1:9333/ozeki";;
String wapPush= " <si>"+
" <indication href=\"http://wap.yahoo.com/\"; action=\"signal-high\">"+
" A WAP Push message, that sends the browser to wap.yahoo.com."+
" </indication>"+
"</si>";
try {
HttpClient client = new HttpClient();
PostMethod method = new PostMethod( url );

// Configure the form parameters
method.addParameter( "login", "admin" );
method.addParameter( "password", "abc123" );
// method.addParameter( "operator", "Vodafone" );
method.addParameter( "action", "sendMessage" );
method.addParameter( "messageType", "SMS:WAPPUSH:application/vnd.wap.sic" );
method.addParameter( "recepient", "  +36205222245" );
method.addParameter( "messageData", wapPush );

// Execute the POST method
int statusCode = client.executeMethod( method );
if( statusCode != -1 ) {
String contents = method.getResponseBodyAsString();
method.releaseConnection();
System.out.println( contents );
}
}
catch( Exception e ) {
e.printStackTrace();
}
}
}


Step 4 - compile the file

javac PostExample.java

Step 5 - send the WAP push message

java PostExample.java

Reference: http://www.ozeki.hu/index.php?ow_page_number=566

Thanks


January 14, 2011 at 2:37 PM


he friend its too good , but if i want to put----

String entryXML= " "+postTitle+" ";

then what name shall i give in place of messageData in addPara?

method.addParameter( "?????????", entryXML );

Please help........

Thanks. Regards, Milind



Related Tutorials/Questions & Answers:
sms gateway - Development process
sms gateway  I need to develop one sms gateway in java. Let me know What are the things required to built that application? And it will be great if anybody is having the functionality related documents or else the development
sms gateway - MobileApplications
sms gateway  Is it possible to create our own sms gateways in java. IF it possible how
Advertisements
sms gateway - MobileApplications
SMS gateway for Java developer  SMS API for JAVA developers  Hi,SMS API for JAVA developersThe following example gives you detailed instructions on how you can send a WAP Push SMS messages from Java. The example uses
Java Developer
Java Developer  Hi, I am engineering student. I want to make career in as Java Developer. How to become a Java Developer? What programming languages... an expert Java Developer? Thanks
Java Developer
Java Developer  What is scenario where i use interface and where use interface
Java Developer
Java Developer  where we should use interface and where we should use abstract class
java developer
java developer  i didnt get the correct ANSWER PLZ EXECUTE THE FOOLWING SERVLET BY USING DATABASE USERLOGIN TABLE VALUES. //validate login.html <html> <body> <body bgcolor="wheat"> <center>
Java SMS Progam
Java SMS Progam  Hai to all, I have to send SMS alerts in my applicaton in java technology with out using any gateways and GSM Modems. Thanks
java sms problem
java sms problem  i am developing web site in which i have to maintain sms system where one can message his/her detail and it should be stored in the database.please give me some idea how to maintain it as i am beginner.Thank you
sending sms with help of java - JavaMail
sending sms with help of java  hi can u plz help me to learn how to send sms with help of java. waiting for your reply
SMS using Java
SMS using Java  I am having a concern , where is the main class in SMSClient.java, if this seems silly please let me know How to execute this java program ?? I am trying to execute this a java application in my eclipse
Sending SMS From Java Programs
Sending SMS From Java Programs  I want to develop and application to send sms from my computer, can someone please help me, like tell me where to start and what i need
Sms to mobile using java application
Sms to mobile using java application  Hi, i want to send sms to mobile using java application. But i dont have any idea for this procees. So kindly suggest me any ideas. regards vijayalakshmi
sms - Java Server Faces Questions
sms  hello .... can any body tell me how to send sms from pc to mobile using java ..an if possible please give me the code in jsp..... my email id is:bharachaitanya@yahoo.co.in
SMS sending questions using java - MobileApplications
using java language for sending SMS...SMS sending questions using java  am doing project sending SMS from pc.how to send bulk SMS ?i achive sending single SMS .but i would like to send
j2me sms coding - Java Beginners
j2me sms coding  please send me the source code to send sms and making a call from mobile
SMS Receiving JAVA application from GSM modem
SMS Receiving JAVA application from GSM modem  Hey does any one having SMS reeving JAVA application
Java/PHP Developer
Java/PHP Developer  Hi, I need a cloak embedded in java swing frame or panel..And it should not change when system time is changed ..please
Java/PHP Developer
Java/PHP Developer  Hi, can u help me to embedd time on java frame and it should be independent of operating system time..if we change system time it should'nt be changed.. Thank you sir
Java/PHP Developer
Java/PHP Developer  how to remove and add a new contentpane on same frame do we have any methods
Java/PHP Developer
Java/PHP Developer  please help me to bring cell values of jtable to a text file
Java/PHP Developer
Java/PHP Developer  help me with passing data from jframe to text file please
Java/PHP Developer
Java/PHP Developer  Hi, can u help me with, question from a text file and answers from another text file with check box
Java/PHP Developer
Java/PHP Developer  how can we get words seperated by delimeters in text file can be imported in jframe like one word for one line
Java/PHP Developer
Java/PHP Developer  Hi, how to create radio buttons on one pannel and should change when pressed ok... can u help me htrough this sooner... THANK U
Java/PHP Developer
Java/PHP Developer  Hi, can u please help me with this, I have a text file with 3 sentences separated by delimiters and i want to get each sentence in different JFrames when press ok button on first frame it should close
Java/PHP Developer
Java/PHP Developer  Hi, can u help me with, question from a text file and answers from another text file with check box..... like a text file containing questions and another text file containing answer of 3 r 4 options,each one
Java/PHP Developer
Java/PHP Developer  Hi, can u help me with, question from a text file and answers from another text file with check box..... like a text file containing questions and another text file containing answer of 3 r 4 options,each one
Java/PHP Developer
Java/PHP Developer  Hi, I have a textfile(notepad1.txt) with 1 question and another textfile(notepad2.txt) with answers(4 options like multiple choice),question is imported from first text file to jframe and 4 options with check
Java/PHP Developer
Java/PHP Developer  HI, I want to know how can we place a link in one jframe to open a videopanel. import java.net.MalformedURLException; import... } // end MediaPanel constructor } // end class MediaPanel   Java create
Java/PHP Developer
Java/PHP Developer  Hello sir, Am working on playing audio file in jframe and im not able to import javax.media into the code.. the code.../java/javase/download-142937.html After downloading, put the jar file under the lib
 

 

 

DMCA.com