SMS is not received to mobile in SMPP Connector - WSO2 EI 6.5.0 - wso2

I am using WSO2 SMPP Connector to send SMS to mobile number in WSO2 EI 6.5.0
Pre-requisites:
Setup done by using the same steps mentioned here
I just placed jsmpp-2.1.0-RELEASE.jar into <PRODUCT_HOME>/lib
logica-smpp-sim simulator set up done and it is running with the port 10003 in windows 10
API:
<?xml version="1.0" encoding="UTF-8"?>
<api context="/send" name="SmppTestApi" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST">
<inSequence>
<property expression="json-eval($.distinationAddress)" name="distinationAddress" scope="default" type="STRING"/>
<property expression="json-eval($.message)" name="message" scope="default" type="STRING"/>
<property expression="json-eval($.sourceAddress)" name="sourceAddress" scope="default" type="STRING"/>
<SMPP.init>
<host>localhost</host>
<port>10003</port>
<systemId>justin</systemId>
<password>justin</password>
<systemType>UNKNOWN</systemType>
<addressTon>UNKNOWN</addressTon>
<addressNpi>UNKNOWN</addressNpi>
</SMPP.init>
<SMPP.sendSMS>
<sourceAddress>{$ctx:sourceAddress}</sourceAddress>
<distinationAddress>{$ctx:distinationAddress}</distinationAddress>
<message>{$ctx:message}</message>
</SMPP.sendSMS>
<log level="full">
<property name="Message delivered sucessfully" value="Message delivered sucessfully"/>
</log>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
When I hit API , it is giving proper response as mentioned here
Postman:
Logica-sim log:
03:16:07 [justin] client request: (submit: (pdu: 108 4 0 3) (addr: 0 0 16111) (addr: 0 0 919047878787) (sm: msg: Hi! This is the first test SMS message.) (opt: ) )
03:16:07 [justin] putting message into message store
03:16:07 [justin] server response: (submit_resp: (pdu: 0 80000004 0 3) Smsc2002 )
WSO2 EI Log:
[2022-10-18 15:16:07,349] [] INFO - LogMediator To: /send, MessageID: urn:uuid:052d3fb7-1762-4323-bea1-5302ddc93d36 correlation_id : e5990fb5-fd97-45d2-b971-878d2471d9e5, Direction: request, Message delivered sucessfully = Message delivered sucessfully, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:messageId xmlns:ns="http://org.wso2.esbconnectors.smppConnector">Smsc2002</ns:messageId></soapenv:Body></soapenv:Envelope>
Note: I passed valid Indian Mobile number in the input request field (ie "distinationAddress")
I think SMS is stored in SMSC, But SMPP inbound endpoint will consume SMS from SMSC and send that to WSO2 EI Sequence.
I just want to understand in which stage SMS will send to corresponding mobile number which we passed in API Request.
Even though Received proper response SMS is not received to mentioned mobile.
Do I need to make any other configuration in API SMPP init level to send SMS? Kindly clarify on this.

The document you pointed out has this.
For testing purposes, it is not practical always to connect with a
real SMSC. 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 this example scenario we will be using logica-smpp-sim simulator.
According to the above logica-smpp-sim is just a simulator, which is used to mimic an actual SMSC for testing. So I don't think it would send SMSs. You may have to connect to a real/production grade SMSC/SMPP Provider or an SMS Gateway if you want to send SMS. You can read more about the SMPP protocol and available Gateways from here.

Related

WSO2 Api Manager log Http request in log mediator

Is there a way to include the http request remote host in the log mediator being used for a specific api?
Having followed the instructions, i can log the soap message, but i have no info regarding the caller of the service.
I currently use the following sequence definition:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="WSO2AM--Ext--In">
<log level="full">
<property name="TRACE" value="Gunet Mediation Extension"/>
</log>
</sequence>
And the result i get when having a call is the following:
INFO - LogMediator To: /SmartSearch/1, WSAction: urn:SearchStudentStatus, SOAPAction: urn:SearchStudentStatus, MessageID: urn:uuid:36f9a5cd-c8cb-4e1e-97a6-f3ebd3303589, Direction: request, TRACE = Gunet Mediation Extension, Envelope: <?xml version='1.0' encoding='utf-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><SearchStudentStatus xmlns="gunet.gr"><SSN>12312312312</SSN><institution>aueb</institution></SearchStudentStatus></S:Body></S:Envelope>
I would like to have information about the remote host that made the specific call. Is that possible, using the log mediator, or should i use a combination of log4j configs?
Thanks!
You can get the remote IP which call the API using following property mediator.
<log level="full">
<property name="Actual Remote Address" expression="get-property('axis2','REMOTE_ADDR')"/>
</log>

WSO2 ESB: how to carry a SOAP answer into a file (or DB) using a scheduled task

I deploy a proxy service in WSO2 ESB that asks a web service for a dataset by a SOAP request and the web service correctly returns the requested dataset. In order to have evidence of the right answer of the web service, how can I do to store this dataset into a generic file during a regular scheduling in a task?
In your proxy def, you can find :
a inSequence executed when a request is sent to this proxy,
a outSequence that receive a response if you send a request from your inSequence (with send mediator)
a faultSequence executed if an error occurs.
So, if you "asks a web service for a dataset" from your inSequence using send mediator, your outSequence receive the response (your "dataset") and you just have to send it to a file :
<!-- name of the file -->
<property name="transport.vfs.ReplyFileName" value="dataset.xml" scope="transport"/>
<!-- OUT_ONLY because we want to use send mediator but don't want a callback waiting for a response -->
<property name="OUT_ONLY" value="true" />
<!-- Send current message (the response from your webService) to the filesystem : test directory must exist on c:\ -->
<send>
<endpoint>
<address uri="vfs:file:///C:/test"/>
</endpoint>
</send>
--> don't forget to activate VFS sender in repository/conf/axis2/axis2.xml : uncomment <transportSender name="vfs" class="org.apache.synapse.transport.vfs.VFSTransportSender"/>

WSO2 ESB - How to send response to Intermediate sequence from service provider?

i was going through a video about "Webinar - ESB - An answer to Enterprise Service Integration" by WSO2 ESB . i have a doubt regarding the video .
it is said in the video that , always in sequence will receive the request and out sequence will return the response from the service provider . An ESb can have multiple intermediate sequence and we can, set to which intermediate sequence service provider has to send the response .
How is it possible when we do not have any control over the service provider ? are we using some queue in between ESB and service provider to accomplish ?
Inside a sequence, when you send a request to a service, you can choose the response-handling sequence (service chaining) :
<send receive="personInfoSeq">
<endpoint key="PersonInfoEpr"/>
</send>
When the ESB sends the request, a callback is instanciated (a dedicated thread) which will wait for the reply and then execute the 'receive' sequence configured in the 'send' mediator
Inside a sequence, when you are working with a response message, you can change it to a request message (<property name="RESPONSE" value="false"/>) and send it to another service
Inside a "in" sequence (when you are working with a request message), you can generate a response, sample :
<inSequence>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<payloadFactory>
<format>
<ns:getQuoteResponse xmlns:ns="http://services.samples">
<ns:return xmlns:ax21="http://services.samples/xsd">
<ax21:change>4.212070096051944</ax21:change>
<ax21:earnings>-9.567415587431361</ax21:earnings>
<ax21:high>-148.1740146577308</ax21:high>
<ax21:symbol>IBM</ax21:symbol>
</ns:return>
</ns:getQuoteResponse>
</format>
</payloadFactory>
<send/>
</inSequence>

WSO2 ESB message id

Do I have any possibility to find message on WSO2 ESB by MessageId, like urn:uuid:e11893c5-b033-4e99-9473-a43d66b65fbb ? For example if some flow failed and server logged such ID.
Maryan,
ESB itself doesn't log messages anywhere until you tell it to.
a) The first approach is to write incoming and outgoing messages into the log using log mediator:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="YourProxyService" transports="https http" startOnLoad="true">
<target>
<inSequence>
<log level="full">
<property name="MESSAGE_ID" expression="get-property('MessageID')"/>
</log>
...
</inSequence>
<outSequence>
<log level="full">
<property name="MESSAGE_ID" expression="get-property('MessageID')"/>
</log>
...
</outSequence>
</target>
</proxy>
Then you'll be able to find your incoming and outgoing messages in log files as the logs would contains something like following:
INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: http://localhost:9763/services/YourProxyService, From: 127.0.0.1, WSAction: urn:mediate, SOAPAction: urn:mediate, Direction: request, MESSAGE_ID = urn:uuid:e11893c5-b033-4e99-9473-a43d66b65fbb , Envelope: <ENVELOPE_GOES_HERE>
b) Another approach would be to create table in the database and store message id and envelope to it.
Hope this helps.
Vladimir.
UPD: You can also use built in SOAP tracer, but enable it with caution - it hits ESB performance. So I suggest use it only for short term debugging activities.
Yes, you can get the message ID using property mediator,
<property name="MessageID" expression="get-property('MessageID')"/>
As others pointed out, you can use log statements in WSO2 ESB to log the messages and search and find later.
But it becomes complex when the message flow fails at some point, as the message IDs will be different across different message flows.
A simple approach would be to read the incoming messagID and use it till the final response message.
Have a look here for detailed explanation.

WSO2 ESB and MB Message Store looses Message Body

i m trying to face up to the integration between WSO2 ESB 4.7.0 and WSO2 MB 2.1.0, following the instructions written at this URL:
http://docs.wso2.org/display/MB210/Integrating+WSO2+ESB
In particular i want to use a message store as a queue. So i follow the paragraph: "Integrate Using Message Stores and Processors".
I created the message store and message processor, having previously well configured ESB and MB as showed.
Finally i wrote this proxy:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="MessageStoreQueueProxy"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<send>
<endpoint>
<address uri="http://localhost:8080/RestService/rest/servizio"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property name="OUT_ONLY" value="true"/>
<store messageStore="JMSMS"/>
<log level="full"/>
</outSequence>
</target>
<description/>
</proxy>
When my client calls the MessageStoreQueueProxy service, on the Message Broker i can see the "JMSMS message store" counter rightly increased but, when i take a look on the "Content Type" field of each message i see just the "Java MessageObject icon", while, in the "body field", i can read just a "not supported" value.
On the other hand, if i browse the JMSMS "message store" in the ESB i can see that the messages' envelopes look like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<root>
<code>ok</code>
<documentID>2546</documentID>
</root>
</soapenv:Body>
</soapenv:Envelope>
So why the body was lost during the transaction? how can i mantain the body? or how can i recover it from the ObjectMessage in the WSO2 MB?
thanks a lot
"Message Store" does not persist the message as it is in the JMS Queue. it serializes the message and other information into java serialized object and put it into JMS Queue.When "Message Processor" processes the message, it pulls Messages from JMS Queue and deserializes the java serialized object to further process.
Here MB is used as JMS Queue. So Message Store serialize and put in MB queue. So you see serialize java object. If you use message store you won't be able see the content in MB.