Could someone tell me what I should add to the call?
This is the WSDL: https://preproduccio.ejcat.justicia.gencat.cat/cee/TTA/TTAImport?wsdl
and this is my code:
try
{
// la url del servicio
string urlServicio = @"https://preproduccio.ejcat.justicia.gencat.cat/cee/TTA/TTAImport?wsdl";
var address = new EndpointAddress(urlServicio);
// creamos la seguridas del transporte
var binding = new BasicHttpsBinding();
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
// creamos el servico que vamos a mandar
var client = new servicioGenCATTTAImport.JwsClient(binding, address);
// añadimos al servicio el certificado (la seguridad)
client.ClientCredentials.ClientCertificate.SetCertificate(
StoreLocation.CurrentUser,
StoreName.My,
X509FindType.FindBySerialNumber,
conexionObject.idCertificadoEmpresa
);
var taulaMaestra = new servicioGenCATTTAImport.ttaconsultaTaulaMestra();
taulaMaestra.dadesTME = new servicioGenCATTTAImport.ttaconsultaTaulaMestraDadesTME();
taulaMaestra.dadesTME.idiomaTME = "ESP";
taulaMaestra.dadesTME.codiTME = "TIPUS_DOCUMENT_ESCRIT";
taulaMaestra.dadesAplicacio = new servicioGenCATTTAImport.ttaconsultaTaulaMestraDadesAplicacio();
var bytes = File.ReadAllBytes(@"C:\Users\angel\OneDrive\Escritorio\certificados\certificadoED.pfx");
taulaMaestra.dadesAplicacio.CDA = bytes;
taulaMaestra.dadesAplicacio.descClient = "ANGEL RODRIGUEZ RUIZ";
taulaMaestra.dadesAplicacio.codiClient = "50817316N";
// llamamos al servicio
var kk = client.consultaTME(taulaMaestra);
return conexionObject;
}
catch (Exception ex)
{
return conexionObject;
}
return null;
I have tried adding the certificate in PFX, .CER (binary and B64) format and nothing, I have tried to request support from the official body that manages it and they answer that this is out of their scope.
Apparently from JAVA, it works perfectly, but I don't know JAVA and I need it to go in .NET core.
I have tried everything I know, (which is very little), in addition we do not have a name or username or password, the identification is done through the use of the certificate.
Thank you very much in advance.