1、添加wenservice引用
http://XXXX/Webservice/SMSWebService.asmx
2、添加一个类,实现接口里面的方法(最好写在BLL中方便项目中调用)
public static SMSWebService.SMSWebService SendSMS()
{
SMSWebService.SMSWebService sendSMS = new SMSWebService.SMSWebService();
return sendSMS;
}
3、动态接口地址的实现
public static BigAntMessage.AntMessage BigAntSendBoard()
{
string strUrl = System.Configuration.ConfigurationManager.AppSettings["IBigAnt"];
strUrl += "/api/message.html?wsdl";
BigAntMessage.AntMessage sendBoard = new BigAntMessage.AntMessage(strUrl);
return sendBoard;
}
时间: 2024-11-08 04:15:56