SMSv2 CSharp
From CDYNE Wiki for Web Services
Using as a Service Reference(.NET Framework 3.5+)
Add a service reference to your project: http://sms2.cdyne.com/sms.svc?wsdl
Contents |
Simple SMS Request
IsmsClient client = new IsmsClient("sms2wsHttpBinding"); SMSResponse resp = client.SimpleSMSsend("17575449510", "Test Simple Message", new Guid("00000000-0000-0000-0000-000000000000")); Console.WriteLine(resp.MessageID); client.Close();
3rd party C# .NET Simple Send SMS tutorial can be found here > Video and Source
Advanced SMS Request
This allows multiple messages and phone numbers to be sent in the same request.
IsmsClient client = new IsmsClient("sms2wsHttpBinding"); SMSAdvancedRequest advReq = new SMSAdvancedRequest(); advReq.LicenseKey = new Guid("00000000-0000-0000-0000-000000000000"); List<SMSRequest> reqs = new List<SMSRequest>(); SMSRequest req = new SMSRequest(); req.Message = "Test Advanced SMS"; req.PhoneNumbers = new string[] {"17575449510", "17579510544"}; // you could send the same message to multiple phone numbers (you will get back a response packet per phone number). req.ReferenceID = "2863172"; // optional and will return with responses. req.AssignedDID = "1555123456"; // Assigned DID (optional). reqs.Add(req); // add more requests here... advReq.SMSRequests = reqs.ToArray(); // adds the array of requests to the SMSAdvancedRequest object. SMSResponse[] smsResponses = client.AdvancedSMSsend(advReq); foreach (var item in smsResponses) { Console.WriteLine(item.MessageID); } client.Close();
Using as a Web Service(.NET Framework 2.0)
Add a web reference to your project: http://sms2.cdyne.com/sms.svc?wsdl
Simple SMS Request
static void Main(string[] args) { SMS_Ref.sms client = new sms(); SMSResponse resp = client.SimpleSMSsend("17575449510", "Test Simple Message", "LICENSEKEY"); Console.WriteLine(resp.MessageID); }
Simple SMS Request (.NET Framework 3.5)
Guid license = new Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX"); WSSMS.IsmsClient c = new IsmsClient("sms2SOAPbasicHttpBinding"); SMSResponse resp = c.SimpleSMSsend("ToNumber", "message", license); Console.WriteLine(resp.MessageID);
Back to SMS Notify!
