Sending SMS using .NET through a Web service By Manoj Kumar C
来源:互联网 发布:淘宝618活动报名入口 编辑:程序博客网 时间:2024/05/06 17:22
Introduction
This article is about sending SMS using .NET through web service. With the help of this article we can easily understand how to use web service in .NET and also you will get some information about SMS, GPRS etc. This web service will help you to give the notification if the service unable to deliver.
How does it work?
Initially when undergoing this study I think sending SMS to different services will be a problem, for sending SMS we have to tie up with all the services it is not possible at all, while studying this most of the services provides GPRS(General Packet Radio Service ) facility. GPRS has more functionality and here we are going to use only one that is Internet email services. So it makes our work little easier. After that I think how to find out the services for that particular mobile number. Now it became very critical, then I found a web service that provides us all the information that we needed. Let we discuss in upcoming paragraph.
What is GPRS?
With GPRS you can enjoy a continuous wireless connection to data networks and access your favorite information and entertainment services. GPRS technology allows mobile phones to be used for sending and receiving data over an Internet Protocol (IP)-based network. GPRS as such is a data bearer that enables wireless access to data networks like the Internet. The applications using GPRS are WAP, MMS, SMS, Java and the PC dial-up (for example, Internet and e-mail).
Internet email services come in the form of a gateway service where the messages are not stored, or mailbox services in which messages are stored. In the case of gateway services, the wireless email platform simply translates the message from SMTP, the Internet email protocol, into SMS and sends to the SMS Center. In the case of mailbox email services, the emails are actually stored and the user gets a notification on their mobile phone and can then retrieve the full email by dialing in to collect it, forward it and so on.
Upon receiving a new email, most Internet email users do not currently get notified of this fact on their mobile phone. When they are out of the office, they have to dial in speculatively and periodically to check their mailbox contents. However, by linking Internet email with an alert mechanism such as SMS or GPRS, users can be notified when a new email is received.
For more information about GPRS click here
Using the code
In this article I am using a web service which already exists. Since this web service is tie up with ICQ instant messaging service make our work easier. With the help of this web service we can able to send SMS to various countries like India, US, UK, Malaysia, Japan etc. In this article I have used the web service from www.webservicex.com they are providing Webs Service Definition Language (WSDL) link for sending SMS.
- For sending SMS to the world: http://www.webservicex.com/sendsmsworld.asmx?WSDL
- For sending SMS to India: http://www.webservicex.net/SendSMS.asmx?WSDL
Here I m attaching the sample code for sending SMS.
private void Send_Click( object sender, System.EventArgs e) { try { SmsTest.net.webservicex.www.SendSMS smsIndia= new SmsTest.net.webservicex.www.SendSMS(); SmsTest.com.webservicex.www.SendSMSWorld smsWorld = new SmsTest.com.webservicex.www.SendSMSWorld(); if(rdoType.SelectedValue == "1") smsIndia.SendSMSToIndia(txtMobileNo.Text.Trim(), txtEmailId.Text.Trim(), txtMessage.Text); else smsWorld.sendSMS(txtEmailId.Text.Trim(), txtCountryCode.Text.Trim(), txtMobileNo.Text.Trim(), txtMessage.Text); lblMessage.Visible = true; lblMessage.Text="Message Send Succesfully"; } catch(Exception ex) { lblMessage.Visible = true; lblMessage.Text="Error in Sending message"+ex.ToString(); } } private void rdoType_SelectedIndexChanged( object sender, System.EventArgs e) { if(rdoType.SelectedValue =="1") txtCountryCode.Enabled = false; else txtCountryCode.Enabled = false; }
Conclusion
The most important feature is it will give mail alerts if the SMS is not send to the user. And it will not support all the services which has GPRS facilities.
- Sending SMS using .NET through a Web service By Manoj Kumar C
- 4.3. Sending Packets Through a Gateway
- Using WinInet to call a Web service
- Using Session State in a Web Service
- HOW TO: Upload a File to a Web Server in ASP.NET by Using Visual Basic .NET
- Sending SMS WAP Push messages using the ActiveXperts SMS and MMS Toolkit.
- Creating a .NET Web Service
- Sending E-Mails using ASP.NET
- [ZT]Sending E-Mails using ASP.NET
- Sending mail from AX using .NET Framework.
- Sending Control Requests to a Service
- Build a service by C#.net(使用C#开发服务提供程序)
- Sending SMS with RSendAs
- 知识库--Sending and Receiving Messages By Akka Using Java(139)
- Build a RESTful Web service using Jersey and Apache Tomcat
- Using The Amazon Web Service From ASP.NET
- Using the Web Service Callbacks in the .NET Application
- jQuery Autocomplete using Web Service in ASP.Net
- 基于.Net Framework的N层分布式应用开发
- Install cvsnt
- lovers -A
- 创建跨多列、多行表头的DataGrid
- 用Ant安装和构建Hibernate项目
- Sending SMS using .NET through a Web service By Manoj Kumar C
- 李开复致中国家长的信:培养快乐感性的孩子
- 深圳—顺德—广州—深圳
- DELETE
- 华山石 观《大长今》评
- 王坚老师语录(转载自spaces.msn.com/members/zfye)
- Building a Better ASP.NET 1.1 BasePage Framework --By Chase Thomas
- 谁有二进制指数退避的具体算法啊
- 使用输出重载时发现的一个奇怪现象!!!