3
使用Visual Studio生成的代碼從MVC2控制器使用以下代碼調用Asmx Web服務。如果證書在.NET中過期,則如何調用https asmx Web服務
自Web服務證書過期以來,方法調用會拋出異常。如何解決這個問題,以便Web服務仍然可以使用?
使用.NET 3.5和MVC2。
public class AsmxController : Controller
{
public ActionResult Index()
{
var cl = new store2.CommerceSoapClient();
// System.ServiceModel.Security.SecurityNegotiationException was unhandled by user code
//Message=Could not establish trust relationship for the SSL/TLS secure channel with authority 'asmxwebservice.com'.
var vl = cl.GetVendorList( AsmxService.LicenseHeader() ,
new AsmxService.GetVendorListRequest());
return View();
}
}
}