Examples of C#, C++, PHP, Perl and Java code for sending messages

Common programming languagues

To help you get started with developing your own web service or application for sending SMS text messages, we are pleased to share the following source code, scripts and applications in a number of popular programming languages. Some of the code examples are provided by Connection Software, and we are delighted to also share with you some of the solutions that our customers have been kind enough to contribute. We hope that these examples will provide the spark of inspiration that you need for your project.

Sample code

We gratefully acknowledge that several of these samples have been provided by our customers. Further contributions will be gratefully received and acknowledged and should be sent via a website support request.

C++Send SMSShow

C++ Send SMS Application Source Code

API:
SMS Web Service SOAP API
Description:
A Linux based solution for sending SMS using the SOAP to SMS API. The makefile downloads the WSDL file from the csoft.co.uk website and then uses gSOAP to generate the client code to make the SOAP calls. An included main.cpp stub provides a simple command-line based method for initiating the sending of a plain text or flash message.
Contributed By:
Connection Software
#include <stdio.h>
#include <signal.h>

#include <string>
using namespace std;

#include "soapServiceProxy.h"

// define the namespace here, because the auto-generated one doesn't  
// get the namespace right.
SOAP_NMAC struct Namespace namespaces[] =
{
	{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
	{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
	{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
	{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
	{"ns1", "http://www.csoft.co.uk/dtd/sendsms5.wsdl", NULL, NULL},
	{"ns2", "http://www.csoft.co.uk/dtd/sendsms5.xsd", NULL, NULL},
	{NULL, NULL, NULL, NULL}
};

#define MAX_URL_LENGTH		    256
#define	MAX_MESSAGE_LENGTH	    5*160
#define MAX_PARAM_LENGTH_DEFAULT    32

const std::string DEFAULT_PRIMARY_GATEWAY_URL("https://www.csoft.co.uk/sendsms5");
const std::string DEFAULT_SECONDARY_GATEWAY_URL("https://www2.csoft.co.uk/sendsms5");

int usage(const char* const progName)
{
    fprintf(stderr, 
	    "Usage: %s -U <Username> -P <PIN> -M <Message> -S <SendTo> -R <ReplyTo> -F <FlashMessage> -I P <Primary SMS Gateway URL> -I S <Secondary SMS Gateway URL> -W <WAP Push HREF>\n\
Default Primary SMS Gateway: %s\nDefault Secondary SMS Gateway: %s\n", 
	    progName,
	    DEFAULT_PRIMARY_GATEWAY_URL.c_str(),
	    DEFAULT_SECONDARY_GATEWAY_URL.c_str());	

    return 0;
}


void sigpipe_handler(int x)
{
    fprintf(stderr, "sigpipe signal raised - broken pipe (%d). terminating", x);
    exit(1);
}


int main(int argc, char *argv[])
{
    Service		    csoftSendSmsSoapApiService;
    std::string		    sUsername,	
			    sPIN,
			    sSendTo,
			    sMessage,
			    sFlashMessage,
			    sReplyTo,
			    sPrimaryURI(DEFAULT_PRIMARY_GATEWAY_URL),
			    sSecondaryURI(DEFAULT_SECONDARY_GATEWAY_URL),
			    sHREF;

    if(argc > 1)
    {
	for(int index = 1; index < argc; index++)
	{
	    if(argv[index][0] == '-')
	    {
		switch(argv[index][1])
		{
		case 'F':		    // flash message
		case 'f':
    		    sFlashMessage.assign(argv[++index], MAX_MESSAGE_LENGTH);
		    break;

		case 'i':
		case 'I':
		    if(argv[++index][0] == 'P')
			sPrimaryURI.assign(argv[++index], MAX_URL_LENGTH);
		    else
			sSecondaryURI.assign(argv[++index], MAX_URL_LENGTH);
		    break;

		case 'm':
		case 'M':
		    sMessage.assign(argv[++index], MAX_MESSAGE_LENGTH);
		    break;

		case 'P':
		case 'p':
    		    sPIN.assign(argv[++index], MAX_PARAM_LENGTH_DEFAULT);
		    break;

		case 'r':
		case 'R':
		    sReplyTo.assign(argv[++index], MAX_PARAM_LENGTH_DEFAULT);
		    break;

		case 'S':
		case 's':
		    sSendTo.assign(argv[++index], MAX_PARAM_LENGTH_DEFAULT);
		    break;

		case 'U':
		case 'u':
		    sUsername.assign(argv[++index], MAX_PARAM_LENGTH_DEFAULT);
		    break;

		case 'w':		    // 
		case 'W':
		    sHREF.assign(argv[++index], MAX_URL_LENGTH);
		    break;

		default:
		    return usage(argv[0]);
		    break;
		}
	    }
	    else
	    {
		return usage(argv[0]);
	    }
	}
    }
    else
    {
	return usage(argv[0]);
    }
  
    csoftSendSmsSoapApiService.soap->connect_timeout = 30;
    csoftSendSmsSoapApiService.soap->send_timeout = 30;
    csoftSendSmsSoapApiService.soap->recv_timeout = 30;

    signal(SIGPIPE, sigpipe_handler);

    {
	_ns2__SubmitMessage	    submitMessage;
	_ns2__SubmitMessageResponse submitMessageResponse;

	ns2__Recipient		    recipient;
	ns2__Message		    message;
	ns2__WAPPush		    WAPPush;
	ns2__si			    si;
	ns2__indication		    indication;
        ns2__SendOptions            sendOptions;
	ns2__DeliveryOption	    deliveryOption = ns2__DeliveryOption__Premier;
        sendOptions.DeliveryOption = &deliveryOption;
        recipient.SendOptions = &sendOptions;
                
	if(!sHREF.empty())
	{
	    indication.href = sHREF;

	    si.indication = &indication;

	    WAPPush.si = &si;

	    message.WAPPush = &WAPPush;
	}

	recipient.SendTo = &sSendTo;        

	message.TextMessage = (sMessage.empty()) ? NULL : &sMessage;
	message.FlashMessage = (sFlashMessage.empty()) ? NULL: &sFlashMessage;

	submitMessage.Username = &sUsername;
	submitMessage.PIN = &sPIN;
	submitMessage.Recipient = &recipient;
	submitMessage.Message = &message;
	submitMessage.ReplyTo = (sReplyTo.empty()) ? NULL: &sReplyTo;
	submitMessage.MessageIdentifier = NULL;
	submitMessage.Reserved = NULL;

	csoftSendSmsSoapApiService.endpoint = sPrimaryURI.c_str();

	if(csoftSendSmsSoapApiService.__ns1__SubmitMessage(&submitMessage, &submitMessageResponse) == SOAP_OK)
	{
	    fprintf(stderr, "Server: %s\n", sPrimaryURI.c_str());
	    fprintf(stderr, "MessageIdentifier: %s\n", submitMessageResponse.MessageIdentifier.c_str());
	    fprintf(stderr, "Report: %s\n", submitMessageResponse.Report.c_str());
	    fprintf(stderr, "Text: %s\n", (submitMessageResponse.Text == NULL) ? "" : submitMessageResponse.Text->c_str());
	} else {
	    csoftSendSmsSoapApiService.endpoint = sSecondaryURI.c_str();

	    if(csoftSendSmsSoapApiService.__ns1__SubmitMessage(&submitMessage, &submitMessageResponse) == SOAP_OK)
	    {
		fprintf(stderr, "Server: %s\n", sPrimaryURI.c_str());
		fprintf(stderr, "MessageIdentifier: %s\n", submitMessageResponse.MessageIdentifier.c_str());
		fprintf(stderr, "Report: %s\n", submitMessageResponse.Report.c_str());
		fprintf(stderr, "Text: %s\n", (submitMessageResponse.Text == NULL) ? "" : submitMessageResponse.Text->c_str());
	    } else  {
		fprintf(stderr, "Message \"%s\" failed due to a SOAP fault...", sMessage.c_str());

		soap_print_fault(csoftSendSmsSoapApiService.soap, stderr);

		exit(1);
	    }
	}	
    }

    exit(0);
}


                  

Download (ZIP)

# This is the makefile for a simple soap client for 
# the Connection Software SOAP To SMS Web Service API

# It uses the gSOAP (http://www.cs.fsu.edu/~engelen/soap.html) 
# toolkit which must be installed first (set SOAPCPP to it's location 
# before building). 

# It has been developed using GCC 3.4.6, gSOAP 1.2.9c and Red Hat Linux but 
# it should work on other Linux/Unix flavours or be easily ported.

# Disclaimer:
# In order to assist you in integrating with our Web Service API's as rapidly as possible, 
# Connection Software offer this source code solution free-of-charge. However, the code is provided as-is, 
# without warranty of any kind, either expressed or implied, and we strongly urge all developers to 
# exhaustively test any applications based on this code prior to deployment.

.DEFAULT: CSoftSendSMSClient

CC=g++

# directories
SRCDIR = 	./
OBJDIR =	$(SRCDIR)obj/
SOAPCPP =	/usr/src/soapcpp/

# sources and objects
SRC= main.cpp soapC.cpp soapClient.cpp 
OBJS= ${OBJDIR}soapC.o ${OBJDIR}soapClient.o ${OBJDIR}stdsoap2.o ${OBJDIR}main.o 

# binary name and version
VersionID=108
BinaryStem=CSoftSendSMSClient

CFLAGS= -I${SOAPCPP} -DDEBUG -O2
LDFLAGS= -lpthread

# generating the binary
CSoftSendSMSClient: soapC.cpp ${OBJS}
	${CC} -o ${BinaryStem}${VersionID} -O2 ${LDFLAGS} ${OBJS}

# generating the object files
${OBJDIR}%.o: %.cpp
	-mkdir ${OBJDIR}
	${CC} ${CFLAGS} -c $^ -o $@
	
# special rule to generate the gsoap library object file
${OBJDIR}stdsoap2.o: $(SOAPCPP)stdsoap2.c
	-mkdir ${OBJDIR}
	${CC} ${CFLAGS} -c $(SOAPCPP)stdsoap2.c -o ${OBJDIR}stdsoap2.o

# generate the csoft service C++ files from the header using the gsoap cpp
soapClient.cpp soapC.cpp: CSoftSendSmsSoapApi.h
	$(SOAPCPP)bin/soapcpp2 -C -L -x -I$(SOAPCPP)import CSoftSendSmsSoapApi.h
	-rm -f *.nsmap
	
# generate a header for the csoft service from the wsdl for it
CSoftSendSmsSoapApi.h: 
	$(SOAPCPP)bin/wsdl2h -o CSoftSendSmsSoapApi.h http://www.csoft.co.uk/dtd/www.sendsms5.wsdl

# thorough clean
clean:
	rm -f ${BinaryStem}${VersionID}
	rm -f ${OBJS}
	rm -f *.wsdl
	rm -f *.xsd
	rm -f *.xml
	rm -f *.log
	rm -f *.nsmap
	rm -f soap*.cpp
	rm -f soap*.h
	rm -f CSoftSendSmsSoapApi.h
	rmdir ${OBJDIR}

                  

Download (ZIP)

Visual C++ .NET Send SMS Application Source Code

API:
SMS Web Service SOAP API
Description:
A complete dialogue-based sample application written using VC++ .NET 2003 which prompts for your Username, PIN, To: number list, and Message and submits it when you press Send. The return from the server is displayed in a pop-up message box.
Contributed By:
Connection Software
// CSoftSendSMS5Client.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "CSoftSendSMS5Client.h"
#include "CSoftSendSMS5ClientDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CCSoftSendSMS5ClientApp

BEGIN_MESSAGE_MAP(CCSoftSendSMS5ClientApp, CWinApp)
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()


// CCSoftSendSMS5ClientApp construction

CCSoftSendSMS5ClientApp::CCSoftSendSMS5ClientApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}


// The one and only CCSoftSendSMS5ClientApp object

CCSoftSendSMS5ClientApp theApp;


// CCSoftSendSMS5ClientApp initialization

BOOL CCSoftSendSMS5ClientApp::InitInstance()
{
	// InitCommonControls() is required on Windows XP if an application
	// manifest specifies use of ComCtl32.dll version 6 or later to enable
	// visual styles.  Otherwise, any window creation will fail.
	InitCommonControls();

	CWinApp::InitInstance();

	AfxEnableControlContainer();

	CoInitialize(NULL);

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	// of your final executable, you should remove from the following
	// the specific initialization routines you do not need
	// Change the registry key under which our settings are stored
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	CCSoftSendSMS5ClientDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	CoUninitialize();

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

                  

Download (ZIP)

// CSoftSendSMS5Client.h : main header file for the PROJECT_NAME application
//

#pragma once

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"		// main symbols


// CCSoftSendSMS5ClientApp:
// See CSoftSendSMS5Client.cpp for the implementation of this class
//

class CCSoftSendSMS5ClientApp : public CWinApp
{
public:
	CCSoftSendSMS5ClientApp();

// Overrides
	public:
	virtual BOOL InitInstance();

// Implementation

	DECLARE_MESSAGE_MAP()
};

extern CCSoftSendSMS5ClientApp theApp;
                  

Download (ZIP)

C#Send SMSShow

Visual C# .NET Send SMS Application Source Code

API:
SMS Web Service SOAP API
Description:
A complete dialogue-based sample application written using C#.NET which prompts for your Username, PIN, To: number list, and Message and submits it when you press Send. The return from the server is displayed in a pop-up message box.
Contributed By:
Colin Millar
The CSoftSmsService.cs file is a customised version of the wrapper for
the SMS service generated by wsdl.exe. There are bugs in the generated 
code which cause an exception to be raised when creating an instance of 
the Service class that you need to send out SMSs. The version here 
represents a fixed copy of this generated file that does not cause this exception.

Colin Millar
colin@colinmillar.com

                  

Download (ZIP)

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using CSoft.SmsService;

namespace TestCSoftSMS
{
	/// <summary>
	/// Sample form for sending an SMS using C# and SOAP
	/// </summary>
	public class MainForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TextBox phoneNumberTextBox;
		private System.Windows.Forms.TextBox messageTextBox;
		private System.Windows.Forms.Button sendButton;
		private System.Windows.Forms.TextBox pinTextBox;
		private System.Windows.Forms.TextBox accountTextBox;
		private System.Windows.Forms.Label toLabel;
		private System.Windows.Forms.Label messageLabel;
		private System.Windows.Forms.Label pinLabel;
		private System.Windows.Forms.Label accountLabel;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public MainForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.sendButton = new System.Windows.Forms.Button();
			this.phoneNumberTextBox = new System.Windows.Forms.TextBox();
			this.messageTextBox = new System.Windows.Forms.TextBox();
			this.toLabel = new System.Windows.Forms.Label();
			this.messageLabel = new System.Windows.Forms.Label();
			this.pinLabel = new System.Windows.Forms.Label();
			this.pinTextBox = new System.Windows.Forms.TextBox();
			this.accountTextBox = new System.Windows.Forms.TextBox();
			this.accountLabel = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// sendButton
			// 
			this.sendButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.sendButton.Location = new System.Drawing.Point(208, 300);
			this.sendButton.Name = "sendButton";
			this.sendButton.TabIndex = 8;
			this.sendButton.Text = "&Send";
			this.sendButton.Click += new System.EventHandler(this.sendButton_Click);
			// 
			// phoneNumberTextBox
			// 
			this.phoneNumberTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.phoneNumberTextBox.Location = new System.Drawing.Point(64, 72);
			this.phoneNumberTextBox.Name = "phoneNumberTextBox";
			this.phoneNumberTextBox.Size = new System.Drawing.Size(216, 20);
			this.phoneNumberTextBox.TabIndex = 5;
			this.phoneNumberTextBox.Text = "";
			// 
			// messageTextBox
			// 
			this.messageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.messageTextBox.Location = new System.Drawing.Point(64, 104);
			this.messageTextBox.MaxLength = 160;
			this.messageTextBox.Multiline = true;
			this.messageTextBox.Name = "messageTextBox";
			this.messageTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.messageTextBox.Size = new System.Drawing.Size(216, 184);
			this.messageTextBox.TabIndex = 7;
			this.messageTextBox.Text = "";
			// 
			// toLabel
			// 
			this.toLabel.Location = new System.Drawing.Point(8, 72);
			this.toLabel.Name = "toLabel";
			this.toLabel.Size = new System.Drawing.Size(48, 23);
			this.toLabel.TabIndex = 4;
			this.toLabel.Text = "&To:";
			this.toLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// messageLabel
			// 
			this.messageLabel.Location = new System.Drawing.Point(0, 96);
			this.messageLabel.Name = "messageLabel";
			this.messageLabel.Size = new System.Drawing.Size(56, 23);
			this.messageLabel.TabIndex = 6;
			this.messageLabel.Text = "&Message:";
			this.messageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// pinLabel
			// 
			this.pinLabel.Location = new System.Drawing.Point(8, 40);
			this.pinLabel.Name = "pinLabel";
			this.pinLabel.Size = new System.Drawing.Size(48, 23);
			this.pinLabel.TabIndex = 2;
			this.pinLabel.Text = "&PIN:";
			this.pinLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// pinTextBox
			// 
			this.pinTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.pinTextBox.Location = new System.Drawing.Point(64, 40);
			this.pinTextBox.Name = "pinTextBox";
			this.pinTextBox.Size = new System.Drawing.Size(216, 20);
			this.pinTextBox.TabIndex = 3;
			this.pinTextBox.Text = "";
			// 
			// accountTextBox
			// 
			this.accountTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.accountTextBox.Location = new System.Drawing.Point(64, 8);
			this.accountTextBox.Name = "accountTextBox";
			this.accountTextBox.Size = new System.Drawing.Size(216, 20);
			this.accountTextBox.TabIndex = 1;
			this.accountTextBox.Text = "";
			// 
			// accountLabel
			// 
			this.accountLabel.Location = new System.Drawing.Point(8, 8);
			this.accountLabel.Name = "accountLabel";
			this.accountLabel.Size = new System.Drawing.Size(48, 23);
			this.accountLabel.TabIndex = 0;
			this.accountLabel.Text = "&Account:";
			this.accountLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 333);
			this.Controls.Add(this.messageLabel);
			this.Controls.Add(this.toLabel);
			this.Controls.Add(this.messageTextBox);
			this.Controls.Add(this.phoneNumberTextBox);
			this.Controls.Add(this.sendButton);
			this.Controls.Add(this.pinLabel);
			this.Controls.Add(this.pinTextBox);
			this.Controls.Add(this.accountTextBox);
			this.Controls.Add(this.accountLabel);
			this.Name = "Form1";
			this.Text = "Send SMS";
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new MainForm());
		}

		private void sendButton_Click(object sender, System.EventArgs e)
		{
			// Basic validation
			if (accountTextBox.Text == string.Empty)
			{
				MessageBox.Show("You must enter your CSoft account here.");
				accountTextBox.Focus();
				return;
			}
			if (pinTextBox.Text == string.Empty)
			{
				MessageBox.Show("You must enter your CSoft PIN number.");
				pinTextBox.Focus();
				return;
			}
			if (phoneNumberTextBox.Text == string.Empty)
			{
				MessageBox.Show("You must enter a phone number.");
				phoneNumberTextBox.Focus();
				return;
			}
			if (messageTextBox.Text == string.Empty)
			{
				MessageBox.Show("You must enter a message.");
				messageTextBox.Focus();
				return;
			}

            // Send the SMS
			Recipient recipients = new Recipient();
			CSoft.SmsService.Message messageContainer = new CSoft.SmsService.Message();
			string smsMessageID = string.Empty;
			Reserved reserved = new Reserved();
			string infoText;
			string libraryNo;
			string result;

			recipients.SendTo = phoneNumberTextBox.Text;
			messageContainer.TextMessage = messageTextBox.Text;
			Service service = new Service();
			result = service.SubmitMessage(accountTextBox.Text, pinTextBox.Text, recipients, messageContainer, null, 
				ref smsMessageID, ref reserved, out infoText, out libraryNo);

			MessageBox.Show(string.Format("Result code of {0} was returned." + Environment.NewLine + Environment.NewLine +
				"Message was '{1}'." + Environment.NewLine + Environment.NewLine + "CSoft message ID is '{2}'.", 
				result, infoText, smsMessageID), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
		}
	}
}

                  

Download (ZIP)

<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 1.3
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">1.3</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1">this is my long string</data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        [base64 mime encoded serialized .NET Framework object]
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        [base64 mime encoded string representing a byte array form of the .NET Framework object]
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used forserialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>1.3</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="sendButton.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="sendButton.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="sendButton.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="phoneNumberTextBox.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="phoneNumberTextBox.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="phoneNumberTextBox.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="messageTextBox.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="messageTextBox.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="messageTextBox.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="toLabel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="toLabel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="toLabel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="messageLabel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="messageLabel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="messageLabel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="pinLabel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="pinLabel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="pinLabel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="pinTextBox.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="pinTextBox.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="pinTextBox.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="accountTextBox.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="accountTextBox.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="accountTextBox.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="accountLabel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="accountLabel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="accountLabel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>(Default)</value>
  </data>
  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>False</value>
  </data>
  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>8, 8</value>
  </data>
  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>True</value>
  </data>
  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>80</value>
  </data>
  <data name="$this.Name">
    <value>Form1</value>
  </data>
  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>True</value>
  </data>
  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Private</value>
  </data>
</root>
                  

Download (ZIP)

//------------------------------------------------------------------------------
// <autogenerated>
//     This code was ORIGINALLY generated by a tool, but has been amended due to a bug in wdsl.exe.
//     Runtime Version: 1.1.4322.2032
//
//     Changes to this file WILL cause incorrect behavior and will be lost if 
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by wsdl, Version=1.1.4322.2032.
// 
namespace CSoft.SmsService 
{
    using System.Diagnostics;
    using System.Xml.Serialization;
    using System;
    using System.Web.Services.Protocols;
    using System.ComponentModel;
    using System.Web.Services;
    

    /// <summary>
    /// CSoft SMS service. Declaration of si class "public item[] info" property has been amended from
    /// "public item[][] info" to "public item[] info" in light of error detail document on Microsoft
    /// site - see http://support.microsoft.com/?scid=kb;en-us;891386&spid=1444&sid=global for more
    /// information.
    /// </summary>
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="Service", Namespace="http://www.csoft.co.uk/dtd/sendsms5.wsdl")]
    public class Service : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        /// <remarks/>
        public Service() {
            this.Url = "http://www.csoft.co.uk/sendsms5";
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Report", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SubmitMessage([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string Username, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string PIN, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] Recipient Recipient, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] Message Message, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string ReplyTo, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] ref string MessageIdentifier, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] ref Reserved Reserved, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] out string Text, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="positiveInteger")] out string LibraryNumber) {
            object[] results = this.Invoke("SubmitMessage", new object[] {
                        Username,
                        PIN,
                        Recipient,
                        Message,
                        ReplyTo,
                        MessageIdentifier,
                        Reserved});
            MessageIdentifier = ((string)(results[1]));
            Reserved = ((Reserved)(results[2]));
            Text = ((string)(results[3]));
            LibraryNumber = ((string)(results[4]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSubmitMessage(string Username, string PIN, Recipient Recipient, Message Message, string ReplyTo, string MessageIdentifier, Reserved Reserved, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("SubmitMessage", new object[] {
                        Username,
                        PIN,
                        Recipient,
                        Message,
                        ReplyTo,
                        MessageIdentifier,
                        Reserved}, callback, asyncState);
        }
        
        /// <remarks/>
        public string EndSubmitMessage(System.IAsyncResult asyncResult, out string MessageIdentifier, out Reserved Reserved, out string Text, out string LibraryNumber) {
            object[] results = this.EndInvoke(asyncResult);
            MessageIdentifier = ((string)(results[1]));
            Reserved = ((Reserved)(results[2]));
            Text = ((string)(results[3]));
            LibraryNumber = ((string)(results[4]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Text", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string SubmitDeliveryReceipt([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string Username, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string PIN, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] System.DateTime Timestamp1, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string SentTo, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] ref string MessageIdentifier, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] ref int Report) {
            object[] results = this.Invoke("SubmitDeliveryReceipt", new object[] {
                        Username,
                        PIN,
                        Timestamp1,
                        SentTo,
                        MessageIdentifier,
                        Report});
            MessageIdentifier = ((string)(results[1]));
            Report = ((int)(results[2]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSubmitDeliveryReceipt(string Username, string PIN, System.DateTime Timestamp1, string SentTo, string MessageIdentifier, int Report, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("SubmitDeliveryReceipt", new object[] {
                        Username,
                        PIN,
                        Timestamp1,
                        SentTo,
                        MessageIdentifier,
                        Report}, callback, asyncState);
        }
        
        /// <remarks/>
        public string EndSubmitDeliveryReceipt(System.IAsyncResult asyncResult, out string MessageIdentifier, out int Report) {
            object[] results = this.EndInvoke(asyncResult);
            MessageIdentifier = ((string)(results[1]));
            Report = ((int)(results[2]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("MessageIdentifier", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string DeliverMessage([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string Username, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string PIN, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] Recipient Recipient, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] Message Message, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string ReplyTo, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] System.DateTime Timestamp1, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlIgnoreAttribute()] bool Timestamp1Specified, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out int Report, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] out string Text) {
            object[] results = this.Invoke("DeliverMessage", new object[] {
                        Username,
                        PIN,
                        Recipient,
                        Message,
                        ReplyTo,
                        Timestamp1,
                        Timestamp1Specified});
            Report = ((int)(results[1]));
            Text = ((string)(results[2]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginDeliverMessage(string Username, string PIN, Recipient Recipient, Message Message, string ReplyTo, System.DateTime Timestamp1, bool Timestamp1Specified, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("DeliverMessage", new object[] {
                        Username,
                        PIN,
                        Recipient,
                        Message,
                        ReplyTo,
                        Timestamp1,
                        Timestamp1Specified}, callback, asyncState);
        }
        
        /// <remarks/>
        public string EndDeliverMessage(System.IAsyncResult asyncResult, out int Report, out string Text) {
            object[] results = this.EndInvoke(asyncResult);
            Report = ((int)(results[1]));
            Text = ((string)(results[2]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Messages", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string AvailableMessages([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string Username, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string PIN, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out Reserved Reserved) {
            object[] results = this.Invoke("AvailableMessages", new object[] {
                        Username,
                        PIN});
            Reserved = ((Reserved)(results[1]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginAvailableMessages(string Username, string PIN, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("AvailableMessages", new object[] {
                        Username,
                        PIN}, callback, asyncState);
        }
        
        /// <remarks/>
        public string EndAvailableMessages(System.IAsyncResult asyncResult, out Reserved Reserved) {
            object[] results = this.EndInvoke(asyncResult);
            Reserved = ((Reserved)(results[1]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Currency", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string AvailableCredit([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string Username, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string PIN, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out string Credit, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out Reserved Reserved) {
            object[] results = this.Invoke("AvailableCredit", new object[] {
                        Username,
                        PIN});
            Credit = ((string)(results[1]));
            Reserved = ((Reserved)(results[2]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginAvailableCredit(string Username, string PIN, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("AvailableCredit", new object[] {
                        Username,
                        PIN}, callback, asyncState);
        }
        
        /// <remarks/>
        public string EndAvailableCredit(System.IAsyncResult asyncResult, out string Credit, out Reserved Reserved) {
            object[] results = this.EndInvoke(asyncResult);
            Credit = ((string)(results[1]));
            Reserved = ((Reserved)(results[2]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Version", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string MobileMessengerVersion([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out string ReleaseNotice, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out string DownloadURL, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out System.DateTime ReleaseDate) {
            object[] results = this.Invoke("MobileMessengerVersion", new object[0]);
            ReleaseNotice = ((string)(results[1]));
            DownloadURL = ((string)(results[2]));
            ReleaseDate = ((System.DateTime)(results[3]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginMobileMessengerVersion(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("MobileMessengerVersion", new object[0], callback, asyncState);
        }
        
        /// <remarks/>
        public string EndMobileMessengerVersion(System.IAsyncResult asyncResult, out string ReleaseNotice, out string DownloadURL, out System.DateTime ReleaseDate) {
            object[] results = this.EndInvoke(asyncResult);
            ReleaseNotice = ((string)(results[1]));
            DownloadURL = ((string)(results[2]));
            ReleaseDate = ((System.DateTime)(results[3]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Report", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int CollectMessages([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string Username, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string PIN, [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlArrayItemAttribute("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out MOMessage[] MessageList) {
            object[] results = this.Invoke("CollectMessages", new object[] {
                        Username,
                        PIN});
            MessageList = ((MOMessage[])(results[1]));
            return ((int)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCollectMessages(string Username, string PIN, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CollectMessages", new object[] {
                        Username,
                        PIN}, callback, asyncState);
        }
        
        /// <remarks/>
        public int EndCollectMessages(System.IAsyncResult asyncResult, out MOMessage[] MessageList) {
            object[] results = this.EndInvoke(asyncResult);
            MessageList = ((MOMessage[])(results[1]));
            return ((int)(results[0]));
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", ResponseNamespace="http://www.csoft.co.uk/dtd/sendsms5.xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("PermittedReplyTo", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string PermittedReplyTo([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string Username, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)] string PIN, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out Reserved Reserved) {
            object[] results = this.Invoke("PermittedReplyTo", new object[] {
                        Username,
                        PIN});
            Reserved = ((Reserved)(results[1]));
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginPermittedReplyTo(string Username, string PIN, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("PermittedReplyTo", new object[] {
                        Username,
                        PIN}, callback, asyncState);
        }
        
        /// <remarks/>
        public string EndPermittedReplyTo(System.IAsyncResult asyncResult, out Reserved Reserved) {
            object[] results = this.EndInvoke(asyncResult);
            Reserved = ((Reserved)(results[1]));
            return ((string)(results[0]));
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class Recipient {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string SendTo;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string SendCc;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string SendBcc;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string SendToAddressBook;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string SendCcAddressBook;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string SendBccAddressBook;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string PhoneMake;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string PhoneModel;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int MCC;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool MCCSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int MNC;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool MNCSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public SendOptions SendOptions;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class SendOptions {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public System.DateTime SendTimeAbsolute;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool SendTimeAbsoluteSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public System.UInt16 SendTimeDelay;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool SendTimeDelaySpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public DeliveryOption DeliveryOption;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool DeliveryOptionSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public bool DisableRepurposing;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool DisableRepurposingSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public bool DisableWalledGardenRule;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool DisableWalledGardenRuleSpecified;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public enum DeliveryOption {
        
        /// <remarks/>
        Default,
        
        /// <remarks/>
        Premier,
        
        /// <remarks/>
        LeastCost,
        
        /// <remarks/>
        Economy,
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class MOMessage {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SendTo;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ReplyTo;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public System.DateTime Timestamp1;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public Message Message;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class Message {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string TextMessage;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string FlashMessage;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public SmartMessage Ringtone;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public SmartMessage OperatorLogo;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public SmartMessage PictureMessage;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public SmartMessage GroupGraphic;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public SMSSUBMITPDU SmsSubmitPdu;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public WAPPush WAPPush;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public MMSNotification MMSNotification;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class SmartMessage {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="positiveInteger")]
        public string LibraryNumber;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="hexBinary", IsNullable=true)]
        public System.Byte[] Data;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public DataFormat Format;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool FormatSpecified;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public enum DataFormat {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("FORMAT-UNDEFINED")]
        FORMATUNDEFINED,
        
        /// <remarks/>
        RTTTL,
        
        /// <remarks/>
        OTA,
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(TypeName="SMS-SUBMIT-PDU", Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class SMSSUBMITPDU {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="hexBinary")]
        public System.Byte[] DataCodingScheme;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="hexBinary")]
        public System.Byte[] ProtocolIdentifier;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="hexBinary")]
        public System.Byte[] UserDataHeader;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="hexBinary")]
        public System.Byte[] UserData;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class WAPPush {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public SimplePush SimplePush;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public MMSLibraryNumber LibraryNumber;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public MMSFileUpload FileUpload;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public si si;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class SimplePush {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="positiveInteger")]
        public string LibraryNumber;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string TextMessage;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class MMSLibraryNumber {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="positiveInteger")]
        public string LibraryNumber;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string TextMessage;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class MMSFileUpload {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string FileName1;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="hexBinary", IsNullable=true)]
        public System.Byte[] FileData1;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string FileType1;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string FileTitle1;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string ContentType1;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class si {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public indication indication;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        [System.Xml.Serialization.XmlArrayItemAttribute(typeof(item), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
        public item[] info;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class indication {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="anyURI")]
        public string href;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("si-id", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string siid;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public System.DateTime created;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool createdSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("si-expires", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public System.DateTime siexpires;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool siexpiresSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public action action;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool actionSpecified;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string content;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public enum action {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("signal-medium")]
        signalmedium,
        
        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("signal-none")]
        signalnone,
        
        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("signal-low")]
        signallow,
        
        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("signal-high")]
        signalhigh,
        
        /// <remarks/>
        [System.Xml.Serialization.XmlEnumAttribute("signal-delete")]
        signaldelete,
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class item {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string pcdata;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="NMTOKEN")]
        public string @class;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class MMSNotification {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public MMSLibraryNumber LibraryNumber;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public MMSFileUpload FileUpload;
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.csoft.co.uk/dtd/sendsms5.xsd")]
    public class Reserved {
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string Field1;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string Field2;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string Field3;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string Field4;
    }
}

                  

Download (ZIP)

C# Send SMS Class Source

API:
SMS Web Service HTTP(S) API
Description:
Send SMS messages using the SMS Web Service HTTP API
Contributed By:
Jon Gianni of J D Wetherspoon PLC
/// 
/// This class is responsible for sending to the SMS gateway.
///     
 public class SMSProxy
 {
  private string[] Gateways = new string[2];
  private static string AccountName = "ABcdefg.123456";
  private static string AccountPIN = "12345678";

  public enum DeliveryServiceOption
  { 
   [Description("Economy")]
   Economy,

   [Description("Premier")]
   Premier,

   [Description("LeastCost")]
   LeastCost
  }

  public static string GetDescription(Enum value)
  {
   FieldInfo fi= value.GetType().GetField(value.ToString()); 
   DescriptionAttribute[] attributes = 
    (DescriptionAttribute[])fi.GetCustomAttributes(
    typeof(DescriptionAttribute), false);
   return (attributes.Length>0)?attributes[0].Description:value.ToString();
  }

  public SMSProxy()
  {
   //
   // TODO: Add constructor logic here
   //
   // list of SMS gateways to use (code will try each in turn if failure encountered.)
   Gateways[0] = "www.csoft.co.uk/sendsms";
   Gateways[1] = "www2.csoft.co.uk/sendsms";
  }

  public void sendSMS(string msg, string sendTo, DeliveryServiceOption deliveryServiceOption, bool sendForReal)
  {

   string Query = "";
   string decodedMsg = decodeMessage(msg);

   // Construct the HTTP query string
   Query = "Username=" + AccountName + "&PIN=" + AccountPIN + "&SendTo=" + sendTo + "&Message=" 
			+ decodedMsg + "&DeliveryServiceOption=" + GetDescription(deliveryServiceOption);
   
   // Only send the message if sending for real (otherwise, if set to zero don't send the message.)
   if (sendForReal == true)
   {
    int qLen;
    qLen = Query.Length;

    // Request and Response objects
    System.Net.WebResponse objRes;
    System.IO.StreamReader sr;
    System.IO.StreamWriter sw;
    
    foreach (string gw in Gateways)
    {
     System.Net.HttpWebRequest objReq = (System.Net.HttpWebRequest) System.Net.WebRequest.Create("http://" + gw);
     objReq.KeepAlive= false;
     objReq.Method = "POST";
     objReq.ContentType = @"application/x-www-form-urlencoded; charset=""utf-8""";
     objReq.ContentLength = qLen;
     objReq.Timeout = 10000;

     // set up access via the proxy server
     System.Net.WebProxy prx = new System.Net.WebProxy("servername", 80);
     prx.BypassProxyOnLocal = true;
     prx.Credentials = new System.Net.NetworkCredential ("username", "password", "domain");
     objReq.Proxy = prx;
     sw  = new System.IO.StreamWriter(objReq.GetRequestStream());
     sw.Write(Query);
     sw.Close();
   
     // get server response
     objRes = objReq.GetResponse();
     sr = new System.IO.StreamReader(objRes.GetResponseStream());
     if (Convert.ToString(sr.ReadToEnd().Substring(0, 2)) == "01")
     { 
      // success, exit loop
      sr.Close();
      objRes.Close();
      break;
     }
    }
   }
  }
  private string decodeMessage(string msg)
  {
   // Convert characters in the message text
   string c;
   string str = "";

   for (int i = 0; i < msg.Length; i++)
   {
    c = msg.Substring(i, 1);
    switch (c)   
    { 
     case " " : 
      c = "%20";
      break;

     case "+" : 
      c = "%2B";
      break;

     case "#" : 
      c = "%23";
      break;

     case "%" : 
      c = "%25";
      break;

     case "&" : 
      c = "%26";
      break;

     case "," : 
      c = "%2C";
      break;
             
     case "." : 
      c = "%2E";
      break;

     case "/" : 
      c = "%2F";
      break;
             
     case ":" : 
      c = "%3A";
      break;

     case ";" : 
      c = "%3B";
      break;

     case "<" : 
      c = "%3C";
      break;
             
     case "=" : 
      c = "%3D";
      break;
             
     case ">" : 
      c = "%3E";
      break;

     case "?" : 
      c = "%3F";
      break;
             
     case "¡" : 
      c = "%A1";
      break;

     case "£" : 
      c = "%A3";
      break;        
    }      
    str = str + c;
   }
   return str;
  }
 }
                  

Download (ZIP)

cURLSend SMSShow

Sending messages using cURL

Language Support:
Command Line
API:
SMS Web Service HTTP(S) API
Description:
Sends secure text messages using the free, open source, multi-platform command line cURL software
Contributed By:
Connection Software
# Language Support: Command Line
# API: Sending SMS Text Messages Web Service HTTP API
# Description: Sends secure text messages using the free, open source, multi-platform command line cURL software (curl.haxx.se)
# Contributed By: Connection Software

SERVER_URL1=https://www.csoft.co.uk/sendsms

echo "Sending message..."
curl -v -H "Content-Type: application/x-www-form-urlencoded" --user-agent "ConnectionSoftware/cURL" --data "Username=ANOther.12345&PIN=1234567&SendTo=447700912345,447700911223&Message=Hello%20World&ResponseFormat=3" ${SERVER_URL1}

echo "Sending message to port 5000..."
curl -v -H "Content-Type: application/x-www-form-urlencoded" --user-agent "ConnectionSoftware/cURL" --data "Username=ANOther.12345&PIN=1234567&SendTo=447700912345&ResponseFormat=3&SmsSubmitPduDataCodingScheme=00&SmsSubmitPduProtocolIdentifier=00&SmsSubmitPduUserDataHeader=06050450000000&Message=This%20is%20a%20message%20to%20port%205000" ${SERVER_URL}

                  

Download (ZIP)

HTMLSend SMSSend MMSShow

HTML Send SMS Form

API:
SMS Web Service HTTP(S) API
Description:
HTML Form to send an SMS message using the SMS Web Service HTTP API
Contributed By:
Connection Software
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
	<HEAD>
		<title>HTTP to SMS API</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</HEAD>
	<body>
		<form name=sendmms action="https://www.csoft.co.uk/sendsms" method="POST" enctype="application/x-www-form-urlencoded">
			<P>
				Enter Your Username:<BR>
				<input type="text" name="UserName" value="Another.12345"><br>
				Enter Your PIN:<BR>
				<input type="text" name="PIN" value="1234567"><br>
				To:<BR>
				<input type="text" name="SendTo" value="447700912345"><br>
				Response Format:<BR>
				<input type="text" name="ResponseFormat" value="1"><br>
				Accompanying Message:<BR>
				<input type="text" name="Message" value="Hello World!"><br>
				<input type="submit" value="Send Now" size="40">
			</P>
		</form>
	</body>
</HTML>

                  

Download (ZIP)

HTML Send MMS Form

API:
SMS Web Service HTTP(S) API
Description:
HTML Form to send an MMS message using the MMS Web Service HTTP API. Note that the file data must be a hex encoded string that is pasted into the form, not a file path or the binary file data.
Contributed By:
Connection Software
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
	<HEAD>
		<title>HTTP to MMS Notification</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</HEAD>
	<body>
		<form name=sendmms action="https://www.csoft.co.uk/sendmms" method="post" enctype="application/x-www-form-urlencoded">
			<P>
				Enter Your Username:<BR>
				<input type="text" name="UserName" value="Another.12345"><br>
				Enter Your PIN:<BR>
				<input type="text" name="PIN" value="1234567"><br>
				Send To:<BR>
				<input type="text" name="SendTo" value="447700912345"><br>
				Response Format:<BR>
				<input type="text" name="ResponseFormat" value="1"><br>
				Accompanying Message:<BR>
				<input type="text" name="Message" value="Here is your mms content!"><br>
				MMS File Name:<BR>
				<input type="text" name="MMSNotificationFileName1" value="myMMS.mms"><br>
				Hex Encoded MMS File Data (max 2048 chars):<BR>
				<input type="text" name="MMSNotificationFileData1" size="2048"><br>
				<input type="submit" value="Send Now" size="40">
			</P>
		</form>
	</body>
</HTML>

                  

Download (ZIP)

JavaSend SMSShow

J2SE Send SMS Application Source Code

API:
SMS Web Service HTTP(S) API
Description:
A complete dialogue-based sample application written using J2SE and the Netbeans 4.0 IDE which prompts for your Username, PIN, To: number list, and Message and submits it when you press Send. The return from the server is displayed in a pop-up message box.
Contributed By:
Connection Software
/*
 * SendSMS.java
 *
 * Created on 06 May 2005, 15:54
 */

package CSoftSendSMS;

import java.net.*;
import java.io.*;
import javax.swing.*;
import javax.net.ssl.HttpsURLConnection;


/**
 *
 * @author  mm
 */
public class SendSMS extends javax.swing.JFrame {
    
    /** Creates new form SendSMS */
    public SendSMS() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        java.awt.GridBagConstraints gridBagConstraints;

        UsernamePrompt = new javax.swing.JLabel();
        UsernameTextField = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        PINTextField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        SendToPrompt = new javax.swing.JLabel();
        SendToTextField = new javax.swing.JTextField();
        MessageTextField = new javax.swing.JTextField();
        SendButton = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();

        getContentPane().setLayout(new java.awt.GridBagLayout());

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Connection Software Java SendSMS Demo");
        UsernamePrompt.setFont(new java.awt.Font("Tahoma", 1, 11));
        UsernamePrompt.setText("Username:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        getContentPane().add(UsernamePrompt, gridBagConstraints);

        UsernameTextField.setFont(new java.awt.Font("Courier", 0, 13));
        UsernameTextField.setToolTipText("Enter your Username here.l");
        UsernameTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                UsernameTextFieldActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        getContentPane().add(UsernameTextField, gridBagConstraints);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("PIN:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        getContentPane().add(jLabel1, gridBagConstraints);

        PINTextField.setFont(new java.awt.Font("Courier", 0, 13));
        PINTextField.setToolTipText("Enter your account PIN number here");
        PINTextField.setPreferredSize(new java.awt.Dimension(12, 24));
        PINTextField.setVerifyInputWhenFocusTarget(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        getContentPane().add(PINTextField, gridBagConstraints);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel2.setText("Message:");
        jLabel2.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel2.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        getContentPane().add(jLabel2, gridBagConstraints);

        SendToPrompt.setFont(new java.awt.Font("Tahoma", 1, 11));
        SendToPrompt.setText("SendTo:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        getContentPane().add(SendToPrompt, gridBagConstraints);

        SendToTextField.setPreferredSize(new java.awt.Dimension(12, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        getContentPane().add(SendToTextField, gridBagConstraints);

        MessageTextField.setMinimumSize(new java.awt.Dimension(6, 40));
        MessageTextField.setPreferredSize(new java.awt.Dimension(73, 60));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        getContentPane().add(MessageTextField, gridBagConstraints);

        SendButton.setText("Send");
        SendButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SendButtonActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        getContentPane().add(SendButton, gridBagConstraints);

        jLabel3.setText("This was sent to your email and looks something like ANOther.61234");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        getContentPane().add(jLabel3, gridBagConstraints);

        jLabel4.setText("This was sent to your mobile/cell phone and looks something like BLUE.Music");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        getContentPane().add(jLabel4, gridBagConstraints);

        jLabel5.setText("Enter the mobile number in international format. eg. 4477009123454");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.ipadx = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        getContentPane().add(jLabel5, gridBagConstraints);

        jLabel6.setText("Enter your message here.");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.ipadx = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        getContentPane().add(jLabel6, gridBagConstraints);

        pack();
    }//GEN-END:initComponents

    private void SendButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SendButtonActionPerformed
        sendToCSoft(this.UsernameTextField.getText(),
                    this.PINTextField.getText(),
                    this.SendToTextField.getText(),
                    this.MessageTextField.getText());
        
    }//GEN-LAST:event_SendButtonActionPerformed

    private void UsernameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UsernameTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_UsernameTextFieldActionPerformed

    private void sendToCSoft(String sUsername, String sPIN, String sSendTo, String sMessage) {
        try {
            URL csoftURL = new URL("https://www.csoft.co.uk/sendsms");
            HttpsURLConnection connection = (HttpsURLConnection)csoftURL.openConnection();
            
            String postBody = "Username=" + URLEncoder.encode(sUsername, "UTF-8") + "&" +
                              "PIN=" + URLEncoder.encode(sPIN, "UTF-8") + "&" +
                              "SendTo=" + URLEncoder.encode(sSendTo, "UTF-8") + "&" +
                              "Message=" + URLEncoder.encode(sMessage, "UTF-8") + "&" +
                              "ResponseFormat=1";

            connection.setRequestMethod("POST");

            // post the parameters
            connection.setDoOutput(true);
            OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream()); 
            wr.write(postBody);
            wr.flush();
            wr.close();

            // now let's get the results
            connection.connect(); // throws IOException
            int responseCode = connection.getResponseCode();  // 200, 404, etc
            String responseMsg = connection.getResponseMessage(); // OK, Forbidden, etc
            BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            StringBuffer results = new StringBuffer();

            String oneline;
            while ( (oneline = br.readLine()) != null) {
              results.append(oneline);
            }

            br.close();
            
            JOptionPane.showMessageDialog(this, "Server Response:" +  URLDecoder.decode(results.toString(), "UTF-8"));
        }
        catch(Exception exception) {
            JOptionPane.showMessageDialog(this, exception.getMessage() + exception.getCause());
        }
    }
        
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SendSMS().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField MessageTextField;
    private javax.swing.JTextField PINTextField;
    private javax.swing.JButton SendButton;
    private javax.swing.JLabel SendToPrompt;
    private javax.swing.JTextField SendToTextField;
    private javax.swing.JLabel UsernamePrompt;
    private javax.swing.JTextField UsernameTextField;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    // End of variables declaration//GEN-END:variables
    
}

                  

Download (ZIP)

<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.0" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
  <Properties>
    <Property name="defaultCloseOperation" type="int" value="3"/>
    <Property name="title" type="java.lang.String" value="Connection Software Java SendSMS Demo"/>
  </Properties>
  <SyntheticProperties>
    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
  </SyntheticProperties>
  <AuxValues>
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-95,0,0,1,-28"/>
  </AuxValues>

  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
  <SubComponents>
    <Component class="javax.swing.JLabel" name="UsernamePrompt">
      <Properties>
        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
          <Font name="Tahoma" size="11" style="1"/>
        </Property>
        <Property name="text" type="java.lang.String" value="Username:"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JTextField" name="UsernameTextField">
      <Properties>
        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
          <Font name="Courier" size="13" style="0"/>
        </Property>
        <Property name="toolTipText" type="java.lang.String" value="Enter your Username here.l"/>
      </Properties>
      <Events>
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="UsernameTextFieldActionPerformed"/>
      </Events>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JLabel" name="jLabel1">
      <Properties>
        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
          <Font name="Tahoma" size="11" style="1"/>
        </Property>
        <Property name="text" type="java.lang.String" value="PIN:"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JTextField" name="PINTextField">
      <Properties>
        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
          <Font name="Courier" size="13" style="0"/>
        </Property>
        <Property name="toolTipText" type="java.lang.String" value="Enter your account PIN number here"/>
        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
          <Dimension value="[12, 24]"/>
        </Property>
        <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JLabel" name="jLabel2">
      <Properties>
        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
          <Font name="Tahoma" size="11" style="1"/>
        </Property>
        <Property name="text" type="java.lang.String" value="Message:"/>
        <Property name="verticalAlignment" type="int" value="1"/>
        <Property name="verticalTextPosition" type="int" value="1"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JLabel" name="SendToPrompt">
      <Properties>
        <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
          <Font name="Tahoma" size="11" style="1"/>
        </Property>
        <Property name="text" type="java.lang.String" value="SendTo:"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JTextField" name="SendToTextField">
      <Properties>
        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
          <Dimension value="[12, 20]"/>
        </Property>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JTextField" name="MessageTextField">
      <Properties>
        <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
          <Dimension value="[6, 40]"/>
        </Property>
        <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
          <Dimension value="[73, 60]"/>
        </Property>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JButton" name="SendButton">
      <Properties>
        <Property name="text" type="java.lang.String" value="Send"/>
      </Properties>
      <Events>
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="SendButtonActionPerformed"/>
      </Events>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JLabel" name="jLabel3">
      <Properties>
        <Property name="text" type="java.lang.String" value="This was sent to your email and looks something like ANOther.61234"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="2" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JLabel" name="jLabel4">
      <Properties>
        <Property name="text" type="java.lang.String" value="This was sent to your mobile/cell phone and looks something like BLUE.Music"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="2" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JLabel" name="jLabel5">
      <Properties>
        <Property name="text" type="java.lang.String" value="Enter the mobile number in international format. eg. 4477009123454"/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="2" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="2" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
    <Component class="javax.swing.JLabel" name="jLabel6">
      <Properties>
        <Property name="text" type="java.lang.String" value="Enter your message here."/>
      </Properties>
      <Constraints>
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
          <GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="2" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
        </Constraint>
      </Constraints>
    </Component>
  </SubComponents>
</Form>

                  

Download (ZIP)

PerlSend SMSHex EncodingReceive SMSShow

Perl Send SMS Script One

API:
SMS Web Service HTTP(S) API
Description:
Perl script to send SMS messages using the SMS Web Service HTTP API. The Perl modules Crypt::SSLeay, LWP::UserAgent and HTTP must be installed.
Contributed By:
Dean Browett (pushnow.com)
use LWP::UserAgent;

sub sendViaSecureHttp {
    my ($contentLength, $queryData) = ;
    my $ua = LWP::UserAgent->new;
    my $req = HTTP::Request->new(POST => 'https://www.csoft.co.uk/sendsms');  
    $req->content_type('application/x-www-form-urlencoded;charset=\"utf-8\"');
    $req->content_length($contentLength);
    $req->content($queryData);   
    my $res = $ua->request($req);

    if ($res->is_success) {   
        #could send email here
        print $res->as_string;
        return 1;
    }

    print "Failed: ", $res->status_line, "\n";
    return 0;
}

                  

Perl Send SMS Script Two

API:
SMS Web Service HTTP(S) API
Description:
Sends SMS text messages. Perl modules LWP::UserAgent and HTTP::Request::Common must be installed.
Contributed By:
Unknown
#!/usr/bin/perl

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
        
my $url_sendsms = "http://www.csoft.co.uk/sendsms";
my($ua,$request,$response,%field);

undef %field;
$field{Username} = "ANOther.61234";
$field{PIN} = "123456";
$field{Message} = "This is a test message";
$field{SendTo} = "447700900010";

$ua = LWP::UserAgent->new;
$request = POST $url_sendsms,%field;  
$response =  $ua->request($request);
if($response->is_success) {
        print response->as_string;
}
else {
        print "Failed: ", $response->status_line, "\n";
}

                  

Perl File Hex Encoding Script

API:
MMS Web Service SOAP API & SMS Web Service HTTP(S) API
Description:
Hex encodes a binary file (image.jpg) such that it can then be submitted using one of the API's that needs any binary data hex encoded first.
Contributed By:
Kenric Mckenzie
open(F, "image.jpg") || die $!;
$s = $hx = "";
while (read(F, $s, 1) > 0) {
    $hx .= sprintf("%02X", ord($s));
    }   
close F;
print "The hex-encoded GIF file is: $hx\n";

                  

Perl Receive SMS Script

API:
SMS Web Service HTTP(S) API
Description:
Receives an HTTP POST from the messaging server and parses out the MO SMS data.
Contributed By:
Connection Software
#!/usr/bin/perl
#***************************************************************************
# Perl example of incoming SMS received via HTTP(S)
#***************************************************************************

use strict;
use CGI;

	#- Get incoming SMS request via HTTP
	my $CGI = new CGI;
	my %incoming;
	$incoming{Username} = $CGI->param('Username');
	$incoming{PIN} = $CGI->param('PIN');
	$incoming{ReplyTo} = $CGI->param('ReplyTo');
	$incoming{SendTo} = $CGI->param('SendTo'); 
	$incoming{Message} = $CGI->param('Message');

	#- .... do something with the data, access a database, etc ...
	
	#- Return reponse
	print $CGI->header(-status=>'200 OK');
	print "Report=0";
	exit(1);

                  

Download (ZIP)

PHPSend SMSReceive SMSShow

PHP Send SMS Script

API:
SMS Web Service HTTP(S) API
Description:
Sends SMS text messages including all the encoding issues.
Contributed By:
Simon Moore
<?php
// Original PHP script written by Simon Moore 19th July 2003
// This script is for csoft.co.uk employees or customers
// and users must have an account with csoft.co.uk
//
// This script will send either SMS or MMS messages and deals 
// with all encoding issues. 
//
// POSSIBLE IMPROVEMENTS:
// It does not use HTTPS which is recommended by csoft.co.uk.
//
// IMPORTANT NOTE
// There is no warranty, implied or otherwise with this software.
//
// LICENCE
// This code has been placed in the Public Domain for all to enjoy.
//
/////////////////////////////////////////////////////////////
// CHANGE HISTORY
// 2007-02-07: Changed Connection:Keep-Alive to Connection: close so that 
// 	a single HTTP request/response (the most common) is much quicker. Thanks to 
// 	Max at Dard for helping identify this change.
//
// 2007-02-08: Updated this comment documentation.
// 2008-05-28: Connection Software (John Coll) added 
//		server failover
//		extensive debug 
//		safe acquisition of query string parameters
//		cleaner layout of source code
//		silenced fsockopen errors - but there is debug
// 2008-06-05: Connection Software (John Coll) added 
//		secure connection using curl. note this does require additional 
//		apache configuration
/////////////////////////////////////////////////////////////
// The variables set at the end of this comment must be modified as follows:
//
// $uname = USERNAME eg: $uname = "USERNAME.12345";
// $pw = PASSWORD eg: $pw = "QWERTYU.POIUYT";
// $pin = PIN number eg: $pin = "12345678";
//
// $uploaddir = UPLOAD DIRECTORY FOR MMS images eg $uploaddir = "uploads/";
//	 ***NOTE - this path must be set world writable in your server directory (ie, chmod 777)
//
// $max_size = MAXIMUM SIZE OF MMS IMAGE IN BYTES eg: $max_size = 10240; (max size is set to 10kb)
//
//
// This script should be saved as 'index.php' in a directory of your choice
// A subdirectory should also exist for MMS uploads (see note above)
//
// MMS content has been limited to JPEG or GIF files, but this could be changed by altering the $userfile_type
// conditions in the 'sendmms' ToDo below

$uname = "another.12345";
$pin = "12345678";
$uploaddir = "uploads/";
$uploaddir = '/var/www/uploads/';
$max_size = 102400;
#
############################################################
# do we want debug ?
$debug=1;
# do we want to use HTTPS for a secure connection?
$secure=1;
############################################################
# $pfile contains the name of this script
$file = $_SERVER["SCRIPT_NAME"];
$break = Explode('/', $file);
$pfile = $break[count($break) - 1];
#
if ($debug) 
	{
	if (! file_exists("/tmp" )) { mkdir("/tmp", 0777); }
	$myFile = "/tmp/" . $pfile . ".log";
	$fh_debug = fopen($myFile, 'a') or die("can't open file");
	fwrite($fh_debug, "\n\n" . $pfile . "\n". date("j F Y G:i:s") . "\n");
	@chmod($myFile,0666);
	}	    
############################################################
# Function definitions
############################################################
function http_post($vars)
	{
	global $debug, $fh_debug, $secure;
	if($secure)
		{
		$urlencoded = "";
		while (list($key, $value) = each($vars))
			{
			$urlencoded.= urlencode($key)."=".$value."&";
			}
		$urlencoded = substr($urlencoded, 0, -1);
	
		if ($debug)  {fwrite($fh_debug, "\nFirst 100 chars of URLENCODED=" . substr($urlencoded,0,100) . "\n");}
	

		$url = "https://www.csoft.co.uk/webservices/http/sendsms";
		$ch = curl_init();    // initialize curl handle
		curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
		curl_setopt($ch, CURLOPT_FAILONERROR, 1);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
		curl_setopt($ch, CURLOPT_TIMEOUT, 5); // times out after 5s
		curl_setopt($ch, CURLOPT_POST, 1); // set POST method
		curl_setopt($ch, CURLOPT_POSTFIELDS, $urlencoded); // add POST fields
		$result = curl_exec($ch); // run the whole process
		curl_close($ch); 
		return $result;
		}

	else	{
		$server1="www.csoft.co.uk";
		$server2="www2.csoft.co.uk";
		$port=80;
		if ($debug)  {fwrite($fh_debug, "PORT=" . $port . "  SERVER=" . $server1 . "\n");}
		# note that the sendsms web service is actually the same as the sendmms service...
		$url= "/webservices/http/sendsms" ;
		$user_agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)";
		#
		$urlencoded = "";
		while (list($key, $value) = each($vars))
			{
			$urlencoded.= urlencode($key)."=".$value."&";
			}
		$urlencoded = substr($urlencoded, 0, -1);
	
		if ($debug)  {fwrite($fh_debug, "\nFirst 100 chars of URLENCODED=" . substr($urlencoded,0,100) . "\n");}
	
		$content_length = strlen($urlencoded);
	
		$headers  = "POST $url HTTP/1.1\n";
		$headers .= "Accept: */*\n";
		$headers .= "Accept-Langauge: en-au\n";
		$headers .= "Content-Type: application/x-www-form-urlencoded\n";
		$headers .= "User-Agent: $user_agent\n";
		$headers .= "Host: $server\n";
		$headers .= "Connection: close\n";
		$headers .= "Cache-Control: no-cache\n";
		$headers .= "Content-Length: $content_length\n\n";
	
		if ($debug)  { fwrite($fh_debug, "\nHEADERS=" . $headers . "\n"); }
	
		# attempt to open connection to server - with failover
	
		$fp = @fsockopen($server1, $port, $errno, $errstr,5);
		if ($fp)
			{
			$report= "server1 opened OK\n";
			if ($debug)  {fwrite($fh_debug, $report . "\n");}
			}
		else
			{
			$report= "server1 failed, trying server2\n";
			if ($debug)  {fwrite($fh_debug, $report . "\n");}
		
			$fp = @fsockopen($server2, $port, $errno, $errstr,10);
			if (!$fp)
				{
				$report= "server2 failed as well\n";
				if ($debug)  {fwrite($fh_debug, $report . "\n");}
				return false;
				}
			else
				{
				$report= "server2 openened OK\n";
				if ($debug)  {fwrite($fh_debug, $report . "\n");}
				}
			}
	
		fputs($fp, $headers);
		fputs($fp, $urlencoded);
	
		$ret = "";
		while (!feof($fp))
			{
			$ret.=fgets($fp, 1024);
			}
		fclose($fp);
		return $ret;
		}
	}
##############################
function ascii_convert($text)
	{
	$text = str_replace(' ', '___SPACE___', $text);
	$text = urlencode($text);
	$text = str_replace('___SPACE___', '%20', $text);
	return $text;
	}
############################################################
# generate the HTML - dependent on parameters passed

echo "<html><head><title>iSend SMS or MMS using HTTP connection</title>";
echo "<body bgcolor=\"#ffffff\" marginheight=\"7\" topmargin=\"7\" marginwidth=\"7\" leftmargin=\"7\" style=\"margin:7px\">";
echo "Software version dated 2008-05-28<br><br>";

$ToDo=$_REQUEST['ToDo'];

if ($ToDo == "")
	{
	if ($debug) 	{ fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); }
	echo "Please choose an option from the list below:<br><br>";
	echo "<li><a href=\"index.php?ToDo=sms\">Send SMS message</a>";
	echo "<li><a href=\"index.php?ToDo=mms\">Send MMS message</a>";
	echo "<br><br>";
	}


elseif ($ToDo == "sms")
	{
	if ($debug) 	{ fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); }
	echo "Please fill in the form below to send your message:<br><br>";
	echo "<form name=\"sms\" method=\"post\" ToDo=\"index.php\">";
	echo "<input type=\"hidden\" name=\"ToDo\" value=\"sendsms\">";
	echo "Full International Format Mobile/Cell Phone Number (i.e. 447700912345):<br>";
	echo "<input type=\"text\" name=\"phone\" size=\"20\">";
	echo "<br><br>Message:<br>";
	echo "<textarea name=\"message\" rows=\"8\" cols=\"40\"></textarea>";
	echo "<br><br>";
	echo "<input type=\"reset\" value=\"clear\">&nbsp;&nbsp;|&nbsp;&nbsp;<input type=\"submit\" value=\"send\">";
	echo "</form>";
	}

elseif ($ToDo == "sendsms")
	{
	if ($debug) 	{ fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); }
	$message=$_REQUEST['message'];
	$phone=$_REQUEST['phone'];
	$message = stripslashes($message);
	$message = ascii_convert($message);
	if ($debug) 	{ fwrite($fh_debug,"MESSAGE=" . $message . "\n");}

	$sending = http_post(array("Username" => $uname, "PIN" => $pin, "SendTo" => $phone, "Message" => $message));
	if ($debug) 	{ fwrite($fh_debug, "SENDING=" .$sending . "\n");}

	echo "Please choose an option from the list below:<br><br>";
	echo "<li><a href=\"index.php?ToDo=sms\">Send SMS message</a>";
	echo "<li><a href=\"index.php?ToDo=mms\">Send MMS message</a>";
	echo "<br><br>";
	}



elseif ($ToDo == "mms")
	{
	if ($debug) 	{ fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); }
	echo "Please fill in the form below to send your message:<br><br>";
	echo "<form enctype=\"multipart/form-data\" ToDo=\"index.php\" method=\"post\">";
	echo "<input type=\"hidden\" name=\"ToDo\" value=\"sendmms\">";
	echo "Full International Format Mobile/Cell Phone Number (i.e 447700912345):<br>";
	echo "<input type=\"text\" name=\"phone\" size=\"20\">";
	echo "<br><br><b>Image:</b> <input name=\"userfile\" type=\"file\">";
	echo "<br><br>Message:<br>";
	echo "<textarea name=\"message\" rows=\"4\" cols=\"50\"></textarea>";
	echo "<br><br><br>";
	echo "<input type=\"reset\" value=\"clear\">&nbsp;&nbsp;|&nbsp;&nbsp;<input type=\"submit\" value=\"send\">";
	}

elseif ($ToDo == "sendmms")
	{
	if ($debug) 	{ fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); }
	$message=$_REQUEST['message'];
	$phone=$_REQUEST['phone'];
	$userfile_name=basename($_FILES['userfile']['name']);
	$userfile_tmp=$_FILES['userfile']['tmp_name'];
	$userfile=$uploaddir . basename($_FILES['userfile']['name']);
	$userfile_size=$_FILES['userfile']['size'];
	$userfile_type=$_FILES['userfile']['type'];
	if ($debug) 	{ fwrite($fh_debug, "UPLOADFILE=". $userfile . "    USERFILE_TMP=". $userfile_tmp . "   USERFILE_SIZE=". $userfile_size . "   USERFILETYPE=" . $userfile_type . "\n"); }
	#
	if (is_uploaded_file($_FILES['userfile']['tmp_name']))
		{
		if ($debug) 	{ fwrite($fh_debug, "MMS file was uploaded\n"); }
		if ($userfile_size > $max_size)
			{
			if ($debug) 	{ fwrite($fh_debug, "MMS file is too big at ". $userfile_size . " bytes\n"); }
			echo "The file is too big.  Please click back to try again with a smaller image.<br><br>";
			exit;
			}

		if ( ! (($userfile_type == "image/gif") || ($userfile_type == "image/jpeg") || ($userfile_type == "image/jpg") || ($userfile_type == "image/pjpeg")))
			{
			if ($debug) 	{ fwrite($fh_debug, "MMS file type invalid\n"); }
			echo "Sorry.  Your file needs to be either a .gif or .jpg file.  Please click back to try again.<br>\n</td></tr>";
			exit;
			}
		else
			{
			if (! move_uploaded_file($_FILES['userfile']['tmp_name'], $userfile))
				{
				if ($debug) 	{ fwrite($fh_debug, "Failed to move MMS file\n"); }
				echo "Sorry.  The upload failed.  Please click back to try again.<br><br>";
				exit;
				}
			else
				{
				if ($debug) 	{ fwrite($fh_debug, "MMS file upload OK\n"); }
				if ($debug) 	{ fwrite($fh_debug, "Username=" . $uname . "\n"); }
				if ($debug) 	{ fwrite($fh_debug, "PIN=" . $pin . "\n"); }
				if ($debug) 	{ fwrite($fh_debug, "SendTo=" . $phone . "\n"); }
				if ($debug) 	{ fwrite($fh_debug, "Message=" . $message . "\n"); }
				if ($debug) 	{ fwrite($fh_debug, "WAPPushFileName1=" . $userfile_name  ."\n"); }
				echo "File <b>$userfile_name</b> uploaded successfully.  Thank you.<br><br>";
				$success = "yes";
				$filehandle = fopen("$userfile", "r");
				$data = fread($filehandle, filesize($userfile));
				fclose ($filehandle);
				$data = bin2hex($data);
				$message = stripslashes($message);
				$message = ascii_convert($message);
				$sending = http_post(array("Username" => $uname, "PIN" => $pin, "SendTo" => $phone, "Message" => $message, "WAPPushFileName1" => $userfile_name, "WAPPushFileData1" => $data));
				$delete = @unlink($userfile);
				if ($debug) 	{ fwrite($fh_debug, "Result=" . $sending . "\n"); }
				}
			}
		}
	else
		{
		if ($debug) 	{ fwrite($fh_debug, "MMS file was NOT uploaded\n"); }
		}
	}
else
	{
	# we should never get here...
	if ($debug) 	{ fwrite($fh_debug, "Invalid - ToDo=" . $ToDo . "\n"); }
	}

fclose($fh_debug);   
?>



                  

Download (ZIP)

PHP Receive SMS Script

API:
SMS Web Service HTTP(S) API
Description:
Receives an HTTP POST from the messaging server and parses out the MO SMS data.
Contributed By:
Connection Software
<?php

    // PHP example script to receive incoming (MO) SMS Messages from HTTP POST
    // - Save this script on your webserver.
    // - On the Connection Software website, configure your Two-Way service to have messages delivered back using HTTP POST.
    // - on the 'Replies via HTTP POST' page, set the URL http://yourwebsite/thisscript. Make sure its a valid URL to this script.
    
    // get variables that have come in.
    $ReplyTo = isset($_REQUEST['ReplyTo']) ? $_REQUEST['ReplyTo'] : null;
    $SendTo = isset($_REQUEST['SendTo']) ? $_REQUEST['SendTo'] : null;
    $Message = isset($_REQUEST['Message']) ? $_REQUEST['Message'] : null;
    $MessageIdentifier = isset($_REQUEST['MessageIdentifier']) ? $_REQUEST['MessageIdentifier'] : null;
    $Timestamp1 = isset($_REQUEST['Timestamp1']) ? $_REQUEST['Timestamp1'] : null;

    // do something with the above variables .. maybe write them to your database
    // ...
    // ...
    

    // Finally print out header
    header("HTTP/1.0");   
    echo "Report=0";


?>

                  

Download (ZIP)

SDKSend SMSReceive SMSShow

Connection Software Windows Send/Receive SMS SDK

Language Support:
Visual C++, Visual Basic 6, Visual Basic 7.NET
API:
SMS Web Service SOAP API
Description:
A Windows DLL based SDK that allows you to simply add the ability to send SMS (and optionally receive) from any application, programming language or scripting language that can call a DLL. Supports secure connections and is compatible with many corporate firewalls and proxy servers. It includes sample code for Visual C++, Visual Basic 6 and Visual Basic 7.NET.
Contributed By:
Connection Software

More info and download...

Unix ShellHex EncodingShow

Unix Shell File Hex Encoding Script

API:
MMS Web Service SOAP API & SMS Web Service HTTP(S) API
Description:
Hex encodes a binary file (image.jpg) such that it can then be submitted using one of the API's that needs any binary data hex encoded first.
Contributed By:
Kenric Mckenzie

od -v -t x1 image.jpg | \
        sed -e 's/^........//' | \
        tr 'a-f' 'A-F' | \
        tr -dc '0-9A-F'

ArchiveSend SMSHex EncodingShow

Visual Basic Send SMS Function Source Code

Language Support:
Microsoft VB.NET
API:
SMS Web Service HTTP(S) API
Description:
Sends SMS text messages with fail-over. Attempts to send the message using the primary server and checks the server response. If there is a problem, it tries the secondary server. If either server responds with success ("01") it exits the loop.
Contributed By:
Mario Menti
<WebMethod()> _        
    Public Function SendSMS(ByVal msg As String, ByVal sendTo As String)

    Dim useMsg As String
    Dim i As Integer
    Dim c As String

    ' Convert characters in the message text
    useMsg = ""
    For i = 1 To Len(msg)
        c = Mid(msg, i, 1)
        Select Case c
            Case vbCrLf : c = "%0A"
            Case vbLf : c = "%0D"
            Case " " : c = "%20"
            Case "+" : c = "%2B"
            Case """" : c = "%22"
            Case "#" : c = "%23"
            Case "%" : c = "%25"
            Case "&" : c = "%26" 
            Case "," : c = "%2C"
            Case "." : c = "%2E"
            Case "/" : c = "%2F"
            Case ":" : c = "%3A"
            Case ";" : c = "%3B"
            Case "<" : c = "%3C"
            Case "=" : c = "%3D"   
            Case ">" : c = "%3E"
            Case "?" : c = "%3F"   
            Case "¡" : c = "%A1"
            Case "£" : c = "%A3"
            Case "#" : c = "%A4"
            Case "Â¥" : c = "%A5"
            Case "§" : c = "%A7"
            Case "Ä" : c = "%C4"
            Case "Å" : c = "%C5"
            Case "à" : c = "%E0"
            Case "ä" : c = "%E4"  
            Case "Ã¥" : c = "%E5" 
            Case "Æ" : c = "%C6" 
            Case "Ç" : c = "%C7"
            Case "É" : c = "%C9"
            Case "è" : c = "%E8"
            Case "é" : c = "%E9"
            Case "ì" : c = "%EC"
            Case "Ñ" : c = "%D1"
            Case "ñ" : c = "%F1"
            Case "ò" : c = "%F2"
            Case "ö" : c = "%F6"  
            Case "Ø" : c = "%D8"
            Case "Ö" : c = "%D6"  
            Case "Ü" : c = "%DC"  
            Case "ù" : c = "%F9"
            Case "ü" : c = "%FC"  
            Case "ß" : c = "%DF" 
        End Select
        useMsg = useMsg + c
    Next

    Dim Query As String
    Dim qLen As Integer

    ' Construct the HTTP query string
    Query = "UN=username.12345" _
        & "&PIN=12345678" _
        & "&N=" & sendTo _
        & "&M=" & useMsg  

    qLen = Len(Query)
    ' Request and Response objects
    Dim objReq As System.Net.HttpWebRequest
    Dim objRes As System.Net.HttpWebResponse

    Dim sr As System.IO.StreamReader
    Dim sw As System.IO.StreamWriter
    Dim Gateways(1)
    Dim gw
    Gateways(0) = "www.csoft.co.uk/sendsms"
    Gateways(1) = "www2.csoft.co.uk/sendsms"

    For Each gw In Gateways
        objReq = System.Net.WebRequest.Create("http://" & CStr(gw))
        objReq.Method = "POST"
        objReq.ContentType = "application/x-www-form-urlencoded;
        charset=""utf-8"""
        objReq.ContentLength = qLen


        sw = New System.IO.StreamWriter(objReq.GetRequestStream())
        sw.Write(Query)
        sw.Close()

       ' get server response
        objRes = objReq.GetResponse
        sr = New System.IO.StreamReader(objRes.GetResponseStream())
        If CStr(Left(sr.ReadToEnd, 2)) = "01" Then ' success, exit loop
            sr.Close()
            objRes.Close()
            Exit For
        End If
    Next
End Function

                  

Visual Basic ASP Send SMS Script

Language Support:
Microsoft Visual Basic ASP Script
API:
SMS Web Service HTTP(S) API
Description:
Sends SMS text messages using the SMS Web Service HTTP API
Contributed By:
Mark Tynan
<%@ Language=VBScript %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="demo" Content="Microsoft">
</HEAD>
<BODY>
<%
dim pnum1
dim phone1
dim newc

newc=0
phone1=request("Message")
pnum1=request("ReplyTo")

url="https://www.csoft.co.uk/sendmms?Username=YOUR-USERNAME&PIN=YOUR-PIN&SendTo="&pnum1&"&si-href=http://www.Mywebsite.co.uk/myscript.asp&si-content=My Product Name"

set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send url
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>
</BODY>
</HTML>

                  

Download (ZIP)

Visual Basic CDONTS Send SMS Source Code

Language Support:
Microsoft Visual Basic
API:
Web Service Email (format 1) API
Description:
Sends SMS text messages using the email format 1 API
Contributed By:
Barry Stanton
<% 
Response.Expires = 0
Dim message_body message_body = "Identifier=1234567"&
        vbCrLf &"|447700912345|Hello World|"& vbCrlf
Set ObjMail = Server.CreateObject("CDONTS.NewMail") 
objMail.To = "ANother.12345@itsarrived.net" 
objMail.Subject ="format1" 
objMail.From = "user@somecompany.co.uk"
objMail.Body = message_body ObjMail.Send
Set ObjMail = Nothing Response.Write"sent"
%> 

                  

Visual BASIC File Hex Encoding Function Source

Language Support:
Microsoft Visual BASIC
API:
MMS Web Service SOAP API & SMS Web Service HTTP(S) API
Description:
Hex encodes a binary file such that it can then be submitted using one of the API's that needs any binary data hex encoded first.
Contributed By:
Kenric Mckenzie
Function HexConvert(ByVal strFileName As String) As String
Dim s As String
Dim hx As String
Open strFileName For Binary Access Read As 1
hx = ""
While (Not EOF(1))
    c = Input$(1, 1)
    If (c <> "") Then
        s = Hex(Asc(c))
        If (Len(s) = 1) Then
            hx = hx + "0" + s
        Else
            hx = hx + s
        End If
    End if
Wend
HexConvert = hx
End Function

                  

The code on this page is provided as-is, without warranty of any kind, either expressed or implied, and we strongly urge all developers to exhaustively test their applications based on this code prior to deployment.