Error consuming web service of the Tax Agency

1

For the sii (Immediate Information System) of the Tax Agency, we have an application developed in Visual Studio 2012 that consumes its webservices. From one day to the next, the call to the webservices is generating the following error:

The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). 
If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. 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" rel="stylesheet" type="text/css">
<script type="text/javascript"> 
		function toggle()
		{
		    var o=document.getElementById("AEAT_errores_tecnicos");
			o.style.display=(o.style.display=='' || o.style.display=='none')?'block':'none';
		}
	</script>
</head>
<body>
<div id="body">	  
	<div id="header">
	<div id="AEAT_header">
	  <div id="topIzquierda">
	  	<div id="logoAEAT">
	  		<ul>
				<li><a target="_self" href="https://www.agenciatributaria.gob.es"><span class="logoGobierno"></span></a>
				</li>
				<li><a target="_self" href="http://www.agenciatributaria.es"><span class="logoAEAT"></span></a>
				</li>
			</ul>	    	
		</div>	  
	 '.

Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory'1 factory, WebException responseException, ChannelBinding channelBinding)
   at System.ServiceModel.Channels.HttpChannelFactory'1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

I have seen multiple responses about what this error can cause: the endpoint is wrong, the certificate is incorrect, the certificate is missing, ...

But what would really be useful for me is getting the complete error.

I saw a forum in which you could capture the InnerException of the ProtocolException that is generated and get the answer from there, but I get the empty InnerException, nor debugging with how to get all the HTML.

Any suggestions on how to get the complete error? Thanks!

    
asked by Guillermo 30.05.2018 в 16:18
source

0 answers