我有以下代码。
public void Submit(string XML)
{
ServicePointManager.ServerCertificateValidationCallback = ValidateCertificate;
TestWS.CW serv = new TestWS.CW();
string s = serv.Check(XML);
}
private static bool ValidateCertificate(object sender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true;
}
但是代码永远不会进入ValidateCertificate
方法....如果我提交标准HttpsWebRequest
但如果我使用网络服务它不起作用。我究竟做错了什么?