DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. SMS With WSO2 ESB

SMS With WSO2 ESB

Let's take a look at how to send an SMS for the request number in the JSON request with a message in JSON.

Madhuka  Udantha user avatar by
Madhuka Udantha
CORE ·
Aug. 12, 18 · Tutorial
Like (2)
Save
Tweet
Share
6.41K Views

Join the DZone community and get the full member experience.

Join For Free

1) Introduction to SMPP and SMSC

SMPP — Short Message Peer to Peer protocol is an open, industry standard protocol designed to provide a flexible data communications interface for transfer of short message data between a Message Center, such as a Short Message Service Centre (SMSC), GSM Unstructured Supplementary Services Data (USSD) Server, or other types of message center and SMS application systems, such as a WAP Proxy Server, Email Gateway, or other messaging gateway. The advantage of supporting SMPP protocol with the Axis2 SMS Transport is that it can be used to send and receive a high volume of short messages very fast. SMPP protocol is an application layer protocol that can be used over TCP. There are many SMPP gateways available in the world, and now almost all the message centers support SMPP.

Use Case 01

There is HTTP SMS API and the user can invoke it with HTTP call with JSON. The API is able to send an SMS for the request number in the JSON request with a message in JSON.

2) Prerequisite

  • JSMPP lib

JSMPP is a Java implementation of SMPP protocol. It provides an API to communicate with an SMSC and JSMPP can be download from here (http://central.maven.org/maven2/com/googlecode/jsmpp/jsmpp/)

  • An SMSC Simulator

SMSC Simulator is an application that can act like an SMSC. Using a simulator, we can test our scenario without having access to a real SMSC. For the real production servers, we have to use a real SMSC. In here we will be using OpenSmpp (https://github.com/OpenSmpp/opensmpp)

  • SMPP connector for ESB

It can be download from here. (https://store.wso2.com/store/assets/esbconnector/details/1f5ca0e2-3fe0-42e5-ae9b-05af1f8e361b)

3) Setting the SMSC Simulator

3.1) Get Git clone on OpenSmpp and build it.

3.2) Create the "users.txt" file in "etc"

3.3) Add following contain for the file

name=wso2esb
password=passesb
timeout=unlimited


3.4) Start the simulator with below command

java -cp opensmpp-core-3.0.3-SNAPSHOT.jar;opensmpp-sim-3.0.3-SNAPSHOT.jar;opensmpp-charset-3.0.3-SNAPSHOT.jar org.smpp.smscsim.Simulator

image

3.5) Enter "1" to "start simulation" and give the port number as "2775."

Then it will start a listener and it is notified with log message as below

image

4) Setting Up the ESB

4.1) Add the "jsmpp_2.1.0.jar" to lib directory in ESB or EI

4.2) Add the SMPP Connector to the WSO2 ESB from the web console or developer studio

5) Creating API

5.1) Create API in wso2 ESB with “POST” method.

5.2) You can get full WSO2 ESB API from here.

5.3) Here is JSON request to pass for that newly created API.

6) Testing API With OpenSmpp

6.1) Send the JSON request from Postman (You will get 202 status to respond)

image

6.2) You will able to see some logs in your simulator as below, such as "Connection accepted."

image

6.3) In the simulator when you press "5," you should see the SMS you send from the API on ESB.

image

References

[1] https://docs.wso2.com/display/ESBCONNECTORS/Sending+SMS+Message#SendingSMSMessage-Overview

Enterprise service bus SMS

Published at DZone with permission of Madhuka Udantha, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Building a Scalable Search Architecture
  • How to Secure Your CI/CD Pipeline
  • Playwright vs. Cypress: The King Is Dead, Long Live the King?
  • Exploring the Benefits of Cloud Computing: From IaaS, PaaS, SaaS to Google Cloud, AWS, and Microsoft

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: