public void sendansms()
{
string [] destarr = new string[1];
destarr[0] = "44711111111";
destarr[1] = "44722222222";
cpLatestBrief.authValue = new auth();
cpLatestBrief.authValue.username = "myusername";
cpLatestBrief.authValue.password = "mypassword";
string creditsused;// = new string("");
string outdesr;// = new string("");
System.DateTime dt = DateTime.Now;
testwebserv1.WebReference.callbackelement cbe = new callbackelement();
cbe.callbackurl = "http://url.com";
cbe.callbacktype = testwebserv1.WebReference.callbacktypeoptions.HTTPGET;
if (cpLatestBrief != null)
{
try
{
//MessageBox.Show("You must enter a name.", "Name Entry Error",MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
cpLatestBrief.SoapSendSms(destarr,"orig",messagetext.Text,testwebserv1.WebReference.mtype.text,"2",dt,false,cbe,out creditsused,out outdesr);
MessageBox.Show(creditsused, "Credits used",MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
catch(SoapHeaderException e)
{
MessageBox.Show(e.Message, "Authentication error",MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
catch(SoapException e)
{
System.Xml.XmlNode node = e.Detail;
string errorcode = e.Detail.FirstChild.InnerText;
string errortext = e.Detail.FirstChild.NextSibling.InnerText;
if(errorcode == "DESTERROR-INVALIDNUMBERS")
MessageBox.Show(e.Message, "Name Entry Error",MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
else if(errorcode == "MESSAGE-NOTSUPPLIED")
MessageBox.Show(e.Message, "Name Entry Error",MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
else
MessageBox.Show(errorcode+e.Message+" "+errortext, "Name Entry Error",MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
return;
}
else
return;
}