After the messages that we exchanged in the comments, I did a search here and saw that this event really R-5011 "Consolidated information for bases and taxes by calculation period" in>, with name evtTotalContrib
, defined in the 'returnTotalizerContribution-v1_03_02.xsd' file) is really just a return event, ie you do not need to fill it out, sign it and send it it is EFD-Reinf that will fill in, sign and return this event to you in the query.
I took a while to understand the query (which they released shortly), because its schema is slightly different from eSocial, and the EFD-Reinf send WebService itself.
I do not know if you already know, and if you have already written the routine for the query, but the address to access the EFD-Reinf query WebService is this one:
link
And the WSDL address, to add a reference to the query service in your project, is this here:
link
But the Query Service WSDL can also be downloaded from this other address:
link
I have noticed that the input parameters for the query service are already set forward in the WSDL, not in a .XSD file, as in the case of eSocial and the EFD-Reinf send service:
<wsdl:types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://sped.fazenda.gov.br/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ConsultaInformacoesConsolidadas">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="tipoInscricaoContribuinte" type="xs:unsignedByte"/>
<xs:element minOccurs="0" maxOccurs="1" name="numeroInscricaoContribuinte" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="numeroReciboFechamento" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
[...]
</xs:schema>
</wsdl:types>
Then I created a test project, I added the reference to the service (I called the service's namespace added by WsConsults ) and I verified that the query would look like this:
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();
You can read a bit more about this query service in the Developer's Guide v1.3 , page 43 to page 53:
link