tags:

views:

13

answers:

0

Hello all I am having a problem and this is the first time I am setting up Mutial SSL for a payment portal the code below is what I am using and the error I am getting is:

System.Web.Services.Protocols.SoapException: No credentials found by which to authorize the user Missing authentication credentials [cert] at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at USBANK.epayWebService.epayWebServiceService.Payment(PaymentRequest PaymentRequest) in c:\users\hp\documents\visual studio 2010\Projects\USBANK\USBANK\Web References\epayWebService\Reference.cs:line 953 at USBANK.Default.Page_Load(Object sender, EventArgs e) in C:\Users\HP\documents\visual studio 2010\Projects\USBANK\USBANK\Default.aspx.cs:line 36

I have never come seen this error before and not sure what the problem is, I know I have to load the .crt file which I am so any help on this it would be great.

Thank you!

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();
        }