Call 040-30133133 for Indian queries, 971-501561627 (UAE) for Middle East, 852-60262470 for Hong kong (or)
Email to: contactus@smscountry.com
Note: If message contains special charcaters like space,@,- etc then please encode the message before passing it into the API call.
'This is done on visual studio
'Just create a new project of vb on VS Studio
'Right Click on Solution Exloprer of project and Selct Add Web Refernces
'On popup box give url as 'http://www.smscountry.com/service.asmx' on textbox and select GO
'And give the namespace, here we give 'SMSC_VB_CLIENT'
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'create object to Service class, which is under namespace we given
Dim client As New SMSC_VB_CLIENT.Service()
'give the username,password,.....
'method for sending text sms
MsgBox(client.SendTextSMS("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...", "TYPE YOUR TEXT SMS", "SENDERID"))
'method for sending flash sms
MsgBox(client.SendFlashSMS("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...", "TYPE YOUR FLASH SMS", "SENDERID"))
'method for sending binary sms
MsgBox(client.SendBinarySMS("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...", "TYPE YOUR Binary SMS", "SENDERID"))
'method for sending unicode sms means laungauge sms,so u should enter text in Hexa Format
'Example:below is original arabic Text
Dim langData as String="063506280627062D002006270644062E064A0631"
MsgBox(client.SendUnicodeSMS("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...",langData, "SENDERID"))
'method for sending logo,so u should enter Text in HEXA Format,As Example Shown Below
'for 'OTA Operater LOGO'
Dim logoData As String="00480E0100003F0FF3F007900007FFFFFE3FFC0C900007FFFFF83FFF189000030
MsgBox(client.SendLOGO("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...", logoData, "SENDERID"))
' method for sending picture sms, so u should enter in HEXA format, As Example Below
' for 'OTA PICTURE MESSAGE ' picData=OTA BIT FILE+BLANK SPACE+ TEXT MESSAGE
Dim picData As String="00481C0100000000000000000000003FF0000FFC00000003FFE04207FFC00000
F3F8FE7800000 Hello, this is a picture with text message"
MsgBox(client.SendPictureSMS("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...", picData, "SENDERID"))
'method for sending wap URL,enter ur URL
MsgBox(client.SendWapPush("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...", "TYPE YOUR TEXT", "SENDERID", "URL"))
'method for sending rintgtone,so u should enter Text in Hexa format, As Example Shown Below
' for OTA RINGTONE
Dim ringData As String="024A3A5505519585B4041E4D1EA28849B628A1084126589368494490624C41 MsgBox(client.SendRingTone("USERNAME", "PASSWORD", "91XXXXXX,91XXXXX,...", ringData, "SENDERID"))
'method for getbalance
MsgBox(client.Getbalance("USERNAME", "PASSWORD"))
'method for GetDeliveryReport MsgBox(client.GetDeliveryReport("USERNAME", "PASSWORD", SMS_Job_No))
End Sub
End Class
/* This client program developed by using AXIS2 of Apache
* set the classpath to all jar files in LIB directory of AXIS2 api
* use ServiceStub class generated by WSDL2JAVA tool,set JAVA_HOME,AXIS2_HOME System variables
*/
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.axis2.databinding.types.UnsignedLong ;
public class Client{
/* SETUP your SENDERID
*empty String refer to 'SMSCOUNTRY'
*/
static String SID="Your SENDERID"; //assign your senderid otherwise give empty string
public static void main(java.lang.String args[])throws Exception {
ServiceStub stub =new ServiceStub();
/* Setup the proxy */
HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties.ProxyProperties();
proxyProperties.setProxyName("your PROXY");
proxyProperties.setProxyPort(YOUR PORT NO);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(200*1000)); // give ur choice of number in Integer
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY, proxyProperties);
/* call the methods,while calling the methods
* you should set the setters in method definitions below like username,password,....
* and also enter message in hexa format for unicodesms,logo,picture,ringtone sms
*/
sendTextMessage(stub);
getSMSCBalance(stub);
getDeliveryreport(stub);
sendUnicodesms(stub);
sendFlashsms(stub);
sendBinerysms(stub);
sendPictureysms(stub);
sendWapsms(stub);
sendRingTone(stub);
sendLogo(stub);
} //end of main method
/* method for send Text SMS,Which internally interacts the SERVICESTUB class */
/* GIVE YOUR DETAILS */
public static void sendTextMessage(ServiceStub stub) {
try{
ServiceStub.SendTextSMS sendmesg = new ServiceStub.SendTextSMS();
sendmesg.setUsername("USERNAME ");
sendmesg.setPassword("PASSWORD ");
sendmesg.setMobilenumbers("9199XXXXXXXX,91XXXXXXXXXX,....");
sendmesg.setMessage(" TYPE YOUR MESSAGE ");
sendmesg.setSenderID(SID);
ServiceStub.SendTextSMSResponse response=stub.SendTextSMS(sendmesg);
System.out.println(response.getSendTextSMSResult());
}
catch(Exception e){
System.out.println("this is from catch");
e.printStackTrace();
}
}
/* method for getbalance on YOUR ACCOUNT and GIVE YOUR DETAILS */
public static void getSMSCBalance(ServiceStub stub) {
try {
ServiceStub.Getbalance getbalance =new ServiceStub.Getbalance();
getbalance.setUsername("USERNAME");
getbalance.setPassword("PASSWORD");
ServiceStub.GetbalanceResponse response=stub.Getbalance(getbalance);
System.out.println(response.getGetbalanceResult());
}
catch(Exception e){
e.printStackTrace();
}
}
/* method for GETDELIVERYREPORT on base of SMC_JOB_NO and GIVE YOUR DETAILS */
public static void getDeliveryreport(ServiceStub stub) {
try {
ServiceStub.GetDeliveryReport deliveryReport = new ServiceStub.GetDeliveryReport();
deliveryReport.setUsername("USERNAME");
deliveryReport.setPassword("PASSWORD");
deliveryReport.setSMS_Job_No(new UnsignedLong(" SMC_JOB_NO "));
ServiceStub.GetDeliveryReportResponse response =stub.GetDeliveryReport(deliveryReport);
System.out.println(response.getGetDeliveryReportResult());
}
catch(Exception e){
e.printStackTrace();
}
}
/* method for sending UNICODE/LANGUAGE SMS
* so u should enter Message in HEXA Format
*/
public static void sendUnicodesms(ServiceStub stub) {
//Example:below is original arabic Text
String uniData="063506280627062D002006270644062E064A0631"
try {
ServiceStub.SendUnicodeSMS sendLangsms = new ServiceStub.SendUnicodeSMS();
sendLangsms.setUsername("USERNAME");
sendLangsms.setPassword("PASSWORD");
sendLangsms.setMobilenumbers("9199XXXXXXXX,91XXXXXXXXXX,......");
sendLangsms.setMessage(uniData);
sendLangsms.setSenderID(SID);
ServiceStub.SendUnicodeSMSResponse response=stub.SendUnicodeSMS(sendLangsms);
System.out.println(response.getSendUnicodeSMSResult());
}
catch(Exception e){
e.printStackTrace();
}
}
/* method for sending FLASH SMS
* for Quick View on screen
*/
public static void sendFlashsms(ServiceStub stub) {
try {
ServiceStub.SendFlashSMS sendFlashsms = new ServiceStub.SendFlashSMS();
sendFlashsms.setUsername("USERNAME");
sendFlashsms.setPassword("PASSWORD");
sendFlashsms.setMobilenumbers("9199XXXXXX,91XXXXXXXX,...");
sendFlashsms.setMessage(" TYPE YOUR SMS ");
sendFlashsms.setSenderID(SID);
ServiceStub.SendFlashSMSResponse response=stub.SendFlashSMS(sendFlashsms);
System.out.println(response.getSendFlashSMSResult());
}
catch(Exception e){
System.out.println("this is from catch");
e.printStackTrace();
}
}
/* Method for Sending BINARY SMS */
public static void sendBinerysms(ServiceStub stub) {
try{
ServiceStub.SendBinarySMS sendBinarymesg = new ServiceStub.SendBinarySMS();
sendBinarymesg.setUsername("USERNAME");
sendBinarymesg.setPassword("PASSWORD");
sendBinarymesg.setMobilenumbers("9199XXXXXXX,91XXXXXXXXX,....");
sendBinarymesg.setMessage(" TYPE YOUR SMS ");
sendBinarymesg.setSenderID(SID);
ServiceStub.SendBinarySMSResponse response=stub.SendBinarySMS(sendBinarymesg);
System.out.println(response.getSendBinarySMSResult());
}
catch(Exception e){
e.printStackTrace();
}
}
/*method for sending PICTURE SMS
* so u should enter Message in Hexa format
*/
public static void sendPictureysms(ServiceStub stub) {
//example for 'OTA PICTURE MESSAGE ' picData=OTA BIT FILE+BLANK SPACE+ TEXT MESSAGE
String picData="00481C0100000000000000000000003FF0000FFC00000003FFE04207FFC00000
try{
ServiceStub.SendPictureSMS sendPicturemesg = new ServiceStub.SendPictureSMS();
sendPicturemesg.setUsername("USERNAME");
sendPicturemesg.setPassword("PASSWORD");
sendPicturemesg.setMobilenumbers("9199XXXXXXX,91XXXXXXXXXXX,....");
sendPicturemesg.setMessage(picData);
sendPicturemesg.setSenderID(SID);
ServiceStub.SendPictureSMSResponse response=stub.SendPictureSMS(sendPicturemesg);
System.out.println(response.getSendPictureSMSResult());
}
catch(Exception e){
e.printStackTrace();
}
}
/* method for sending WAP PUSH
* Type ur URL
*/
public static void sendWapsms(ServiceStub stub) {
try{
ServiceStub.SendWapPush sendWapmesg = new ServiceStub.SendWapPush();
sendWapmesg.setUsername("USERNAME");
sendWapmesg.setPassword("PASSWORD");
sendWapmesg.setMobilenumbers("9199XXXXXXX,91XXXXXXXXX,...");
sendWapmesg.setMessage("TYPE YOUR SMS");
sendWapmesg.setSenderID(SID);
sendWapmesg.setWapUrl("TYPE URL");
ServiceStub.SendWapPushResponse response=stub.SendWapPush(sendWapmesg);
System.out.println(response.getSendWapPushResult());
}
catch(Exception e){
e.printStackTrace();
}
}
/* method for sending RINGTONE
* so u should enter message in Hexa Format
*/
public static void sendRingTone(ServiceStub stub) {
//example for 'OTA Ringtone'
String ringData="024A3A5505519585B4041E4D1EA28849B628A1084126589368494490624C41
26E0A28C49B628B314508420A24D511824DC1265A9364000"
try{
ServiceStub.SendRingTone sendRintone = new ServiceStub.SendRingTone();
sendRintone .setUsername("USERNAME");
sendRintone .setPassword("PASSWORD");
sendRintone .setMobilenumbers("9199XXXXXX,91XXXXXXX,....");
sendRintone .setMessage(ringData);
sendRintone .setSenderID(SID);
ServiceStub.SendRingToneResponse response=stub.SendRingTone(sendRintone );
System.out.println(response.getSendRingToneResult());
}
catch(Exception e){
e.printStackTrace();
}
}
/* method for sending LOGO
* so u should enter message in hexa format
*/
public static void sendLogo(ServiceStub stub) {
//example for 'OTA Operater LOGO'
String logoData="00480E0100003F0FF3F007900007FFFFFE3FFC0C900007FFFFF83FFF189000030
try{
ServiceStub.SendLOGO sendLogo = new ServiceStub.SendLOGO();
sendLogo .setUsername("USERNAME");
sendLogo .setPassword("PASSWORD");
sendLogo .setMobilenumbers("9199XXXXXX,91XXXXXXXX,....");
sendLogo .setMessage(logoData);
sendLogo .setSenderID(SID);
ServiceStub.SendLOGOResponse response=stub.SendLOGO(sendLogo);
System.out.println(response.getSendLOGOResult());
}
catch(Exception e){
e.printStackTrace();
}
}
}
}
Facebook Twitter LinkedIn Google Plus