Reinf - Event Consultation 2099 -closing

Asked

Viewed 262 times

0

I’m performing the R2099 Closing Event query, based on the question:

Reinf - Event error R-5011

Using the same way @Pedro Gaspar demonstrated:

var urlServicoConsulta = @"https://preprodefdreinf.receita.fazenda.gov.br/ConsultasReinf.svc";
var address = new System.ServiceModel.EndpointAddress(urlServicoConsulta);
var binding = new System.ServiceModel.BasicHttpsBinding();  //Disponível desde .NET Framework 4.5
// ou:
//var binding = new System.ServiceModel.BasicHttpBinding(BasicHttpsSecurityMode.Transport);
binding.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Certificate;

// Instancia o cliente para acessar o serviço de consulta do EFD-Reinf.
var wsClient = new WsConsultas.ConsultasReinfClient(binding, address);
wsClient.ClientCredentials.ClientCertificate.Certificate = x509Cert;

// Solicita uma consulta, passando os parâmetros e recebendo o evento R-5011 como retorno.
System.Xml.Linq.XElement retornoTotalContrib = wsClient.ConsultaInformacoesConsolidadas(1, "10220048", "4308-2099-1701-4308");
wsClient.Close();

On my call:

System.Xml.Linq.XElement retornoTotalContrib = wsClient.ConsultaInformacoesConsolidadas(1, "01628604", "15598-2099-1812-15598");

Is returning the following error:

  Message=There was no endpoint listening at https://preprodefdreinf.receita.fazenda.gov.br/ConsultasReinf.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

There was no endpoint listening at ...

The Reference service I added is pointing to this url: https://preprodefdreinf.receita.fazenda.gov.br/WsREINF/ConsultasReinf.svc?singleWsdl

Any idea what might be going on?

  • It’s probably the header SOAPAction, see if you are reporting the correct: http://sped.fazenda.gov.br/ConsultasReinf/ConsultaInformacoesConsolidadas.

  • 1

    In the error is the url: https://preprodefdreinf.receita.fazenda.gov.br/ConsultasReinf.svc, the service Ference you said is pointing is: https://preprodefdreinf.receita.fazenda.gov.br/WsREINF/ConsultasReinf.svc?singleWsdl. Which url should you use after all? There is a distortion of information (WsREINF) at the url...

1 answer

2


This is what you have already guessed in the question itself and that have answered more or less in the comments: The address of the service I used in that answer was out of date (already updated the reply), the addresses are now these:

For the Restricted Production Environment (test):
https://preprodefdreinf.receita.fazenda.gov.br/WsReinfConsultas/ConsultasReinf.svc

For the Production Environment (official):
https://reinf.receita.fazenda.gov.br/WsReinfConsultas/ConsultasReinf.svc

So you have to update this line of code:

var urlServicoConsulta =
  @"https://preprodefdreinf.receita.fazenda.gov.br/WsReinfConsultas/ConsultasReinf.svc";
  • You’re right. The url that was on my Reset service was also outdated!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.