Good morning,
when I consume a public web service in C#
I get this message.
What can be due?
The content type text/html
of the response message does not match the content type of the text/xml; charset=utf-8
link. If you use a custom encoder, make sure that the IsContentTypeSupported
method is implemented correctly.
The first 1024 bytes of the response were:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="es-ES">
<head>
<title>Agencia Tributaria - Se ha producido un error</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="https://www.agenciatributaria.gob.es/static_files/common/css/xzhtcs04.css" orel="stylesheet" type="text/css">
<script type="text/javascript">
function toggle()
{
var o=document.getElementById("AEAT_errores_tecnicos");
o.style.display=(o.style.display=='' || .style.display=='none')?'block':'none';
}
This is my code, can it be that the certificate is not well added?
X509Store store = new X509Store(StoreName.My,
StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
LRConsultaEmitidasType ddd = new LRConsultaEmitidasType();
SuministroLRFacturasEmitidas iverview = new SuministroLRFacturasEmitidas();
// sca.ClientCertificates.Add(store.Certificates[3]);
sca.ClientCredentials.ServiceCertificate.SetDefaultCertificate(StoreLocation.CurrentUser, StoreName.My, X509FindType.FindBySerialNumber, "1234567890");
//sca.(principal);
try
{
sca.SuministroLRFacturasEmitidas(principal);
}
catch (Exception ex)
{
}