How can fixed endPoint error?

42 views Asked by At

I have the method that call a remote web service. So I have some problem with this method. This is the code:

try { 
    string pathCertificato = @"C:\Users\public\Desktop\Certificati\keystore_healthnet.pfx";
    X509Certificate2 certificatoLocale = new X509Certificate2(File.ReadAllBytes(pathCertificato), "password");


    PianoAssistenzialeResidenzialeClient ws_Client = new PianoAssistenzialeResidenzialeClient();
    ws_Client.ClientCredentials.ClientCertificate.Certificate=certificatoLocale;
    ws_Client.ClientCredentials.ServiceCertificate.DefaultCertificate = certificatoLocale;


    ws_Client.ClientCredentials.UserName.UserName = "username";
    ws_Client.ClientCredentials.UserName.Password = "password";

    PianoAssistenzialeResidenzialeService.attributiAutorizzativi attributi = new PianoAssistenzialeResidenzialeService.attributiAutorizzativi();
    attributi.identificativoServizio="ElencoDomicilio";
    attributi.identificativoUtente="123456789";
    attributi.ruoloIstituzionale="RUOLO1010";


    ws_Client.getElencoPAIDomiciliare(attributi, new PianoAssistenzialeResidenzialeService.getElencoPAIDomiciliare());

    }
    catch (Exception e)
    {
    Console.WriteLine(e);
    Console.WriteLine(e.StackTrace);
    }
}

if I try to run this code, I have an error at this point:

ws_Client.getElencoPAIDomiciliare(attributi, new PianoAssistenzialeResidenzialeService.getElencoPAIDomiciliare());

the error is:

Unable to complete the Identity Control for MESSAGE in output . The identity of the remote Expected DNS was ' test.tuodominio.it ' MA HEALTHNET the ' remote endpoint has a certificate Supplied DNS '

0

There are 0 answers