WSDL for this webservice is available at http://www.webservicex.net/SendSMS.asmx?WSDL
This webservice covers the following networks in India – Airtel, Idea Cellular, Skycell , RPG Cellular, Hutch, Celforce / Fascel, BPL Mobile, Escotel.
If you are on WAS6.4
Follow the steps explained in the weblog titled BSP a Developer’s Journal Part XIV – Consuming WebServices with ABAP by Thomas Jung (follow the method described under the subheading ‘Release 640‘) to create the client proxy and the program to execute the proxy to consume the webservice. Thomas has explained it well with screen shots on how to create the client proxy and also given a sample program to consume the same, and i don’t feel a need to re-explain the same here.
If you are on WAS6.20
Create a report program from se38 and copy/paste the code below.
REPORT y_sms_to_india620.
DATA: http_client TYPE REF TO if_http_client .
DATA: wf_string TYPE string ,
result TYPE string ,
r_str TYPE string .
DATA: result_tab TYPE TABLE OF string.
SELECTION-SCREEN: BEGIN OF BLOCK a WITH FRAME .
PARAMETERS: mail(100) LOWER CASE,
m_no(20) LOWER CASE ,
m_mss(120) LOWER CASE.
SELECTION-SCREEN: END OF BLOCK a .
START-OF-SELECTION .
CLEAR wf_string .
CONCATENATE
‘http://www.webservicex.net/SendSMS.asmx/SendSMSToIndia?MobileNumber=‘
m_no
‘&FromEmailAddress=’
mail
‘&Message=’
m_mss
INTO
wf_string .
CALL METHOD cl_http_client=>create_by_url
EXPORTING url = wf_string
IMPORTING client = http_client
EXCEPTIONS argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR result .
result = http_client->response->get_cdata( ).
REFRESH result_tab .
SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
LOOP AT result_tab INTO r_str.
WRITE:/ r_str .
ENDLOOP .
I tried this from Saudi Arabia to a BPL mobile at Trichy/India and it works!
Excellent job!
It really works!
Thank you.
Nagarjuna.
How is it working for you now? Can you explain, where you went wrong before?Bcoz i got response in HTTP Client prog but i did not receive msg in my mobile.
Thanks
i tried the code given by m.r athavan raja but i din't get any positive results kindly send me the document of sending sms via abap code
🙁
Nagarjuna
Iam doing HTML->Webservice scenario and am using HTTP Client prog for sending request.
In my HTTP Client prog I got the response, the same response should be recived by my mobile as SMS, but it did not happen? What else needs to be done?
Thanks a lot
Regards
Raja
I tried using the Web Service in ECC 6.0 with Web Dynpro ABAP as front end to get the inputs. When I execute the service I get the result as Message Sent Successfully for BPL Mobile Number but the SMS doesn't reach the recepient. Could help me with troubleshooting this problem?
Regards,
Supriya.
this weblog is really helpful for me for understanding about consuming web services from abap. I am trying to execute the sample program given by you but received above exception in method http_client->receive. Please guide me and let me know if I am missing any required configuration.
Thank you.
Regards
Raja
Hi Raja,
I have tried doing code as you have mentioned. but i am still not able to configure the font size and all that you have mentioned. could you please tell me how to configure that? and where it need to configure it to.
I have seen many replies that they are saying the code is working but i am not able to do so.
Please help me for the same.
Thanks in advance
Pritam
That was due to some formatting issue , which has been fixed now.
Thanks
Pritam
Dear Sir,Vishal
i used the same code but i'm not getting error message but the message is not reaching the target phone as well.
Could you please let me know what exactly i need to do here ?
Thanks & regards,
JOmy
Please Help me in this.
Thanks & Regards.
<br/>Hi iam Getting like This When i Execute The Program can u please solve my problem<br/><br/><br/><br/><html><head><title>Application Server Error</title><br/><style type="text/css"><br/>body { font-family: arial, sans-serif;}<br/></style><br/></head><br/><BODY text="#172972" link="#808080" vlink="#808080"<br/>alink="#8e236b" bgcolor=white leftmargin="0" topmargin="0"<br/>marginheight="0" marginwidth="0"><br/><table height="61" width="100%" border="0" cellspacing="0"<br/>cellpadding="0"><tr><td background="http://mytecsap02.mytecsoft.com:8001/sap/public/icman/img/bluebar_tile.gif"<br/>height="30"><table> <tr> <td width=5></td> <td width=20% nowrap><font face=arial size="-1" color=white>SAP Web Application Server<br/></font></td><td width=75% align="right" nowrap><font face=arial<br/>size="-1" color="white">Help
404 Resource not found
Partner not reached
</FONT><br/></td></tr></table><br/></body></html><br/><br/><br/>
It required & work on Centerl instance only,I confirgured HTTP NODe in SCOT and test sms is going , How can I using this program ? So that RFC which I crated work usign HTTP NODe and I can Monitor using T-code sost,
Pl.Help
I tried the same code,but i am also getting the same error as others mentioned in the blog.Pls guide me as to what extra configurations have to be made to send an sms.
this program workin won Cental instance only where in background mode, where as I would like run on any aplication server for that I create RFC for desired URL and also configured HTTP node.
it is workign with HTTP client proxy setting which direct connection from program and URL
I need help how can we attach this program with HTTP node sothat we can monitor through SOST.
sanjay
Hi Sir,Help
404 Resource not found
Partner not reached
</FONT><br/></td></tr></table><br/></body></html><br/><br/><br/><br/>Thnaks in advance<br/>
<?xml version="1.0" encoding="utf-8"?><br/><SMSResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.webserviceX.NE<br/> <FromEmailAddress>chandrababu.g@wentregue.com</FromEmailAddress><br/> <MobileNumber>919243444741</MobileNumber><br/> <Provider>Not Covered</Provider><br/> <State>Not Covered</State><br/> <Status>Not Covered</Status><br/></SMSResult>
Hi,
Could you please let me know what i need to do since the message is not reaching to the Mobile even though i got Message Sent successfully message ?
hello Durai,Jomy
Do you have any other way for example, any other Webservice or other method by which i can send SMS from a ABAP program ?
Thanks & regards,
Jomy
http://www.webservicex.net/WS/WSDetails.aspx?CATID=4&WSID=59
does it work here and not work from your ABAP
i'm getting the response of application error give the possible ways to overcome this issue if u figured it .but i deeply appriciate u on ur fantastic work dude i'm pasting the screen i got on ur exceution of ur program go through that and check out to avoid to get sucessfully to transmitt my message to the mobile from abap<br/><br/><br/>&----
&<br/><br/><br/><br/><html><head><title>Application Server Error</title> <br/><style type="text/css"><br/>body font-family: arial, sans-serif;<br/></style><br/></head><br/><BODY text="#172972" link="#808080" vlink="#808080"<br/>alink="#8e236b" bgcolor=white leftmargin="0" topmargin="0"<br/>marginheight="0" marginwidth="0"><br/><table height="61" width="100%" border="0" cellspacing="0"<br/>cellpadding="0"><tr><td background="http://mytecsap02.mytecsoft.com:8010/sap/public/icman/img/bluebar_tile.gif"<br/>height="30"><table> <tr> <td width=5></td> <td width=20% nowrap><font face=arial size="-1" color=white>SAP Web Application Server<br/></font></td><td width=75% align="right" nowrap><font face=arial<br/>size="-1" color="white">Help
404 Resource not found
Partner not reached
RM-T18, U2855, 800 DEVELOPER, mytecdtp014, 15:53:39, M0, W5, SEU_, 3/2
while using sms some time it give error
like this
(1) the specified serial port is not avalable
(2)
can some one tell me why it is coming
This was a great article and it helped me configure the SMS settings for my client.
I was facing the NIEHOST_UNKNOWN error for a long time and there was no solution from our BASIS team. Further analysis revealed that the DNS settings were not proper.
A few things that can be done in this case :
(1)Check the DNS settings of the server
(2)Try to put the IP address of the service instead of www.domain.com name. This will solve 90% of the problems
(3)Check the HTTP ICF settings and see if the port is working using netstat(AIX) command.
Hope this helps others as I had to dig deep to find the solution.
Thanks,
Aditya
Hi Durairaj,
Your code really helped me to send sms well. But my requirement exceeds message length. Can we increase message length.
Regards,
Gokulan N