0
After successfully sending the R1000 event, through the questions:
- C# - EFD Reinf v1_04_00 - How to instantiate and fill all Event properties?
- How to consume EFD-Reinf Webservice in C#? (Sending Events)
I got the return on the variable and I need to treat it:
var retornoEnvioXElement = wsClient.ReceberLoteEventos(doc.Root);
? return
{<Reinf xmlns="http://www.reinf.esocial.gov.br/schemas/retornoLoteEventos/v1_04_00">
<retornoLoteEventos id="IDF4EBD1BA1DDE6A0B288DD85C8DF1E535">
<ideTransmissor>
<IdTransmissor>01628604000140</IdTransmissor>
</ideTransmissor>
<status>
<cdStatus>0</cdStatus>
<descRetorno>SUCESSO</descRetorno>
</status>
<retornoEventos>
<evento id="ID1016286040000002018121309305100001">
<Reinf xmlns="http://www.reinf.esocial.gov.br/schemas/evtTotal/v1_04_00">
<evtTotal id="ID-1066770329">
<ideEvento>
<perApur />
</ideEvento>
<ideContri>
<tpInsc>1</tpInsc>
<nrInsc>01628604</nrInsc>
</ideContri>
<ideRecRetorno>
<ideStatus>
<cdRetorno>0</cdRetorno>
<descRetorno>SUCESSO</descRetorno>
</ideStatus>
</ideRecRetorno>
<infoRecEv>
<dhProcess>2018-12-13T09:31:39.1306938-02:00</dhProcess>
<tpEv>1000</tpEv>
<idEv>ID1016286040000002018121309305100001</idEv>
<hash>dw94b8lBK83zUyVwc6p8obI8F1fc/Ag0NkU2QHWi/Og=</hash>
</infoRecEv>
<infoTotal>
<nrRecArqBase>14009-04-1000-1812-14009</nrRecArqBase>
<ideEstab>
<tpInsc>0</tpInsc>
</ideEstab>
</infoTotal>
</evtTotal>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<Reference URI="#ID-1066770329">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>sfY6hV4oPUQhpjcLMZa61Odj8xEQOvAdyLXJOYfvS4g=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>[...]</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>[...]</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
</Reinf>
</evento>
</retornoEventos>
</retornoLoteEventos>
</Reinf>}
I ask you: Which fields should I store for later queries of what has already been sent?
I was expecting the nrProtEntr
"Event delivery protocol number", but it did not come in this return. That’s right?
Only the <hash>dw94b8lBK83zUyVwc6p8obI8F1fc/Ag0NkU2QHWi/Og=</hash>
is sufficient for in the future to recover Delivery Receipts?
Doubt: on the line: var returns I created this way... Is returning me the following error: on the line Return(T)Xs.Deserialize(Reader) from Function Deserializefromxnode<T> Returns the following error: System.Invalidoperationexception: 'There is an error in XML Document (0, 0). ' Internal Exception: Invalidoperationexception: <Reinf xmlns='http://www.reinf.esocial.gov.br/schemas/returns.
– Vagner Costa
? (T)Xs. Deserialize(reader);
'(T)xs.Deserialize(reader)' gerou uma exceção do tipo 'System.InvalidOperationException'
 Data: {System.Collections.ListDictionaryInternal}
 HResult: -2146233079
 HelpLink: null
 InnerException: {"<Reinf xmlns='http://www.reinf.esocial.gov.br/schemas/returns } Message: "There is an error in XML Document (0, 0)." 
 Source: "System.Xml"
 StackTrace: " at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)\r\n at ...
– Vagner Costa
That, in this case
RetornoLoteEventos
is the namespace. What is the content of the return variableretornoEnvioXElement
when you hover over, on debug? There’s something or it’s empty?– Pedro Gaspar
In class
Reinf
which was generated by the 'XSD.exe' tool, for the schemaretornoLoteEventos
, the value of the parameterNamespace
, of the attributeXmlTypeAttribute
, is how? Is the same value that is there in the error, and in the return XML? By schema official, the value should be"http://www.reinf.esocial.gov.br/schemas/retornoLoteEventos/v1_04_00"
.– Pedro Gaspar
I found out: this line you mentioned was commented on due to error... [System.xml.Serialization.Xmltypeattribute(Anonymoustype=true, Namespace="http://www.reinf.esocial.gov.br/schemas/evtTotal/v1_04_00")] Thank you
– Vagner Costa
the instance of var events = return Send? .return I put, and on the line : var returns CS1503 Argument 1: Unable to convert from "Return Events.Tarquivoreinf" to "System.xml.Xmlnode"
– Vagner Costa
@Vagnercosta, yes, was missing one
;
at the end of that line, and there was also an error in the line of performance, I’m sorry. I edited the answer, see if it now works.– Pedro Gaspar
@Vagnercosta, did you test it? Now it worked?
– Pedro Gaspar
Yes, it worked! Thank you very much! I had already flagged your comment as "useful"!
– Vagner Costa