SMS gateway for Java developer

SMS gateway for Java developer

SMS API for JAVA developers

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
ModuleNotFoundError: No module named 'pl-tmobile-sms-gateway'
ModuleNotFoundError: No module named 'pl-tmobile-sms-gateway'  Hi...: No module named 'pl-tmobile-sms-gateway' How to remove the ModuleNotFoundError: No module named 'pl-tmobile-sms-gateway' error? Thanks   Hi
ModuleNotFoundError: No module named 'python_sms_gateway'
ModuleNotFoundError: No module named 'python_sms_gateway'  Hi, My... named 'python_sms_gateway' How to remove the ModuleNotFoundError: No module named 'python_sms_gateway' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'python_sms_gateway'
ModuleNotFoundError: No module named 'python_sms_gateway'  Hi, My... named 'python_sms_gateway' How to remove the ModuleNotFoundError: No module named 'python_sms_gateway' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'python_sms_gateway'
ModuleNotFoundError: No module named 'python_sms_gateway'  Hi, My... named 'python_sms_gateway' How to remove the ModuleNotFoundError: No module named 'python_sms_gateway' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'rest-sms-gateway'
ModuleNotFoundError: No module named 'rest-sms-gateway'  Hi, My... named 'rest-sms-gateway' How to remove the ModuleNotFoundError: No module named 'rest-sms-gateway' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-sms-gateway'
ModuleNotFoundError: No module named 'django-sms-gateway'  Hi, My... named 'django-sms-gateway' How to remove the ModuleNotFoundError: No module named 'django-sms-gateway' error? Thanks   Hi, In your
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/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  help me with passing data from jframe to text file please
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  how to remove and add a new contentpane on same frame do we have any methods
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  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
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 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
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 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
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 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
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:[email protected]
SMS Receiving JAVA application from GSM modem
SMS Receiving JAVA application from GSM modem  Hey does any one having SMS reeving JAVA application
j2me sms coding - Java Beginners
j2me sms coding  please send me the source code to send sms and making a call from mobile
Version of com.aliyun>aliyun-java-sdk-sms dependency
List of Version of com.aliyun>aliyun-java-sdk-sms dependency
Java Developer Training
Java Developer training are provided by Roseindia for the Java developers... and work there way up. The Java Developer training program includes the Servlet... the developers to learn new programs and topics in Java. The Java developer
Sms Progam
Sms Progam  i have to send SMS from pc to mobile in my java program
java code for sending sms - JSP-Servlet
java code for sending sms  hello sir, I want a code for sending sms on mobile . please send me if u have this Thanks & regards Dharmendra
SMS alert system using Java - JSP-Servlet
SMS alert system using Java  Respected Sir/Mam, I need to develop an SMS alert application. Scope of the application: Basically... recipients. This can be developed using any kind of componentsThanks
How to send sms alerts to mobile using java?
How to send sms alerts to mobile using java?  Hi i have used the Code to send message on mobile using java code, it is not working - COM2 javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier
Sr. Java Developer with EJB Experience
Sr. Java Developer with EJB Experience       Position Vacant: Sr. Java Developer with EJB...; Keywords: J2EE, JEE, EJB, Java, Development, Software system, 
com.tencentcloudapi - tencentcloud-sdk-java-sms version 3.1.816 Maven dependency. How to use tencentcloud-sdk-java-sms version 3.1.816 in pom.xml?
; com.tencentcloudapi - tencentcloud-sdk-java-sms library is 3.1.816. Developer can...com.tencentcloudapi  - Version 3.1.816 of tencentcloud-sdk-java-sms Maven... of tencentcloud-sdk-java-sms in pom.xml? How to use tencentcloud-sdk-java-sms version
com.tencentcloudapi - tencentcloud-sdk-java-sms version 3.1.725 Maven dependency. How to use tencentcloud-sdk-java-sms version 3.1.725 in pom.xml?
; com.tencentcloudapi - tencentcloud-sdk-java-sms library is 3.1.725. Developer can...com.tencentcloudapi  - Version 3.1.725 of tencentcloud-sdk-java-sms Maven... of tencentcloud-sdk-java-sms in pom.xml? How to use tencentcloud-sdk-java-sms version
com.tencentcloudapi - tencentcloud-sdk-java-sms version 3.1.718 Maven dependency. How to use tencentcloud-sdk-java-sms version 3.1.718 in pom.xml?
; com.tencentcloudapi - tencentcloud-sdk-java-sms library is 3.1.718. Developer can...com.tencentcloudapi  - Version 3.1.718 of tencentcloud-sdk-java-sms Maven... of tencentcloud-sdk-java-sms in pom.xml? How to use tencentcloud-sdk-java-sms version
Maven dependency for merlin-developer - merlin-developer-core version 20040423.083017 is released. Learn to use merlin-developer-core version 20040423.083017 in Maven based Java projects
-developer - merlin-developer-core version 20040423.083017 ) in their Java...-developer - merlin-developer-core version 20040423.083017 in Java projects... - merlin-developer-core version 20040423.083017 java library in your project. ADS
SMS alert system in Java - JSP-Servlet
SMS alert system in Java  Hi, I have asked this questions 2 days before and awaiting answer. But i didn't get any replies so far?? Any experts please help me
Maven Dependency aliyun-java-sdk-sms >> 3.0.0-rc1
You should include the dependency code given in this page to add Maven Dependency of com.aliyun >> aliyun-java-sdk-sms version3.0.0-rc1 in your project

Ads