Reputation: 83
I send Text messages using soap webservice here's the function:
public static string SendSms(string Message, string Phone, string BranchName)
{
string result;
try
{
var sms = new WebServiceSMS.SendMessageSoapClient();
sms.SendSms(WebConfigurationManager.AppSettings["UserName"], WebConfigurationManager.AppSettings["Pwd"], Message, Phone, BranchName, "0");
result = "Successful";
return result;
}
catch
{
result = "failed";
return result;
}
}
the XML response looks like that:
how do I read from XML as webservice method call has completed?
Upvotes: 0
Views: 523
Reputation: 119
It looks like you are looking to return the XML response from sms.SendSMS():
public static string SendSms(string Message, string Phone, string BranchName)
{
try
{
var sms = new WebServiceSMS.SendMessageSoapClient();
return sms.SendSms(WebConfigurationManager.AppSettings["UserName"], WebConfigurationManager.AppSettings["Pwd"], Message, Phone, BranchName, "0");
}
catch
{
return "Failed";
}
}
Upvotes: 1