我试了一天了,参数没有错啊,为什么调用发送方法就返回异常了呢??希望有做过的朋友帮个忙,提点提点我,拜托各位大哥了!!!
代码如下:
SendSmsService SmsService = new SendSmsService();
//消息头
RequestSOAPHeader header = new RequestSOAPHeader();
header.spId = spId;
header.timeStamp = "04011025";
header.spPassword = spPwd;
header.productId = "114000000000000011195";
header.OA = "";
header.FA = "";
SmsService.RequestSOAPHeaderValue = header;
//目标服务器地址
SmsService.Url = "http://222.77.183.102:5080/isag/North/SMS/SendSms";
//消息内容
sendSms SmsInfo = new sendSms();
SmsInfo.addresses = new string[] { "tel:+8613859098178" };
SmsInfo.message = "测试短信0123456789ABCDEFGabcdefg";
SmsInfo.senderName = "10659447";
ChargingInformation charging = new ChargingInformation();
charging.description = "费用描述";
charging.currency = "货币";
charging.amountSpecified = true;
charging.amount = 0;
charging.code = "code";
SmsInfo.charging = charging;
string strErrorMessage = "OK";
try
{
sendSmsResponse smsResponse = SmsService.sendSms(SmsInfo);
}
------解决方案--------------------
参考
------解决方案--------------------
既然说是soapheader的问题,看看文档示例上soapheader是不是少赋什么值了?