您好,我遇到了一个问题,这是我第一次为付款门户网站设置Mutual SSL,下面的代码是我正在使用的代码,出现的错误是:
System.Web.Services.Protocols.SoapException:未找到用于授权用户的凭据缺少System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage消息,WebResponse响应,流responseStream,布尔asyncCall的身份验证凭据[cert]在System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串methodName,Object []参数)在USBANK.epayWebService.epayWebServiceService.Payment(PaymentRequest PaymentRequest)在c:\ users \ hp \ documents \ visual studio 2010 \ Projects \ USBANK \ USBANK \ Web引用\ epayWebService \ Reference.cs:USBANK.Default.Page_Load(Object sender,EventArgs e)中的第953行位于C:\ Users \ HP \ documents \ visual studio 2010 \ Projects \ USBANK \ USBANK \ Default.aspx .cs:第36行
我以前从未见过此错误,也不知道是什么问题,我知道我必须加载.crt文件,因此对此的任何帮助都将非常有用。
谢谢!
string certPath = "C:\\inetpub\\SSLCertificate.cer";
Documents\\Visual Studio 2010\\Projects\\USBANK\\USBANK\\SSLCertificate.cer";
epayWebService.CardNotPresentCredit CNPC = new epayWebService.CardNotPresentCredit();
epayWebService.PaymentRequest PR = new epayWebService.PaymentRequest();
epayWebService.BillerCredential BC = new epayWebService.BillerCredential();
epayWebService.PaymentMethod PM = new epayWebService.PaymentMethod();
epayWebService.GetPaymentRequest GPR = new epayWebService.GetPaymentRequest();
epayWebService.PaymentResponse Response = new epayWebService.PaymentResponse();
BC.billerGroupID = "xxx";
BC.billerID = "xxx";
PR.billerCredential = BC;
PR.paymentAmount = 0;
PR.paymentDate = DateTime.Now;
CNPC.cardNumber = "xxxxxxxxxxxxxx";
PM.Item = CNPC;
PR.paymentMethod = PM;
PR.productCode = "Menu";
try
{
epayWebService.epayWebServiceService ep = new epayWebService.epayWebServiceService();
ep.Url = "https://xxx.xxxxxxxxx.com/EPayWebService/";
ep.ClientCertificates.Add(X509Certificate.CreateFromCertFile(certPath));
Response = ep.Payment(PR);
LabelResponse.Text = Response.response.ToString();
}
catch(Exception ex)
{
LabelResponse.Text = ex.ToString();
}
最佳答案
我们遇到了这个问题,事实证明这是我们发送了错误的证书。您需要附加证书,而不是USBank证书。