On ConsumptionEvent Error 215 Rejection: XML Schema Failure

0

I am trying to consume the event reception service on the farm, specifically inform the science about an NFE:

https://www.nfe.fazenda.gov.br/RecepcaoEvento/RecepcaoEvento.asmx

But I got the following return:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <nfeRecepcaoEventoResult xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento">
            <retEnvEvento versao="1.00" xmlns="http://www.portalfiscal.inf.br/nfe">
                <idLote>000000000000000</idLote>
                <tpAmb>1</tpAmb>
                <verAplic>AN_1.0.0</verAplic>
                <cOrgao>91</cOrgao>
                <cStat>215</cStat>
                <xMotivo>Rejeicao: Falha no Esquema XML</xMotivo>
            </retEnvEvento>
        </nfeRecepcaoEventoResult>
    </soap:Body>
</soap:Envelope>

The message I have sent is:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
        <nfeCabecMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento">
            <cUF>31</cUF>
            <versaoDados>1.00</versaoDados>
        </nfeCabecMsg>
    </soap:Header>
    <soap:Body xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento">
        <nfeDadosMsg>
            <envEvento versao="1.00" xmlns="http://www.portalfiscal.inf.br/nfe">
                <idLote>1</idLote>
                <evento versao="1.00">
                    <infEvento Id="ID210210[Chave NFE]1">
                        <cOrgao>91</cOrgao>
                        <tpAmb>1</tpAmb>
                        <CNPJ>[CNPJ]</CNPJ>
                        <chNFe>[Chave NFE]</chNFe>
                        <dhEvento>2015-11-09T11:12:51-02:00</dhEvento>
                        <tpEvento>210210</tpEvento>
                        <nSeqEvento>1</nSeqEvento>
                        <verEvento>1.00</verEvento>
                        <detEvento versao="1.00">
                            <descEvento>Ciencia da Operacao</descEvento>
                        </detEvento>
                        <Signature>
                            <SignedInfo>
                                <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
                                <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
                                <Reference URI="">
                                    <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/2000/09/xmldsig#sha1" />
                                    <DigestValue>[Caracteres]</DigestValue>
                                </Reference>
                            </SignedInfo>
                            <SignatureValue>[Caracteres]</SignatureValue>
                            <KeyInfo>
                                <X509Data>
                                    <X509Certificate>[Caracteres]</X509Certificate>
                                </X509Data>
                            </KeyInfo>
                        </Signature>
                    </infEvento>
                </evento>
        </envEvento>
        </nfeDadosMsg>
    </soap:Body>
</soap:Envelope>

Using the RS validation service:

link

The result indicates that the content is correct

The example used by Sefaz RS is: (of course consuming another type of service)

<envEvento xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.00">
    <idLote>1</idLote>
    <evento xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.00">
        <infEvento Id="ID1101104311090016960400016655100000888905100000001201">
            <cOrgao>43</cOrgao>
            <tpAmb>2</tpAmb>
            <CNPJ>00169604000166</CNPJ>
            <chNFe>43110900169604000166551000008889051000000012</chNFe>
            <dhEvento>2011-09-20T09:15:09-03:00</dhEvento>
            <tpEvento>110110</tpEvento>
            <nSeqEvento>1</nSeqEvento>
            <verEvento>1.00</verEvento>
            <detEvento versao="1.00">
                <descEvento>Carta de Correcao</descEvento>
                <xCorrecao>Correcao da nota fiscal que estou digitando</xCorrecao>
                <xCondUso>A Carta de Correcao e disciplinada pelo paragrafo 1o-A do art. 7o do Convenio S/N, de 15 de dezembro de 1970 e pode ser utilizada para regularizacao de erro ocorrido na emissao de documento fiscal, desde que o erro nao esteja relacionado com: I - as variaveis que determinam o valor do imposto tais como: base de calculo, aliquota, diferenca de preco, quantidade, valor da operacao ou da prestacao; II - a correcao de dados cadastrais que implique mudanca do remetente ou do destinatario; III - a data de emissao ou de saida.</xCondUso>
            </detEvento>
        </infEvento>
        <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/2000/09/xmldsig#rsa-sha1" />
                <Reference URI="#ID1101104311090016960400016655100000888905100000001201">
                    <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/2000/09/xmldsig#sha1" />
                    <DigestValue>7qXu+s5v/kVyghiVWezRzegHfmo=</DigestValue>
                </Reference>
            </SignedInfo>
            <SignatureValue>V/Z7+ht7CaAOXxE99OUDmyox4jt+lyEJLdJQM1ya1Rwr8pAxCG3VS75KixpGnvSsfZwMCOlNluKl07DIOU5OirUjmnP8Oj7QgZu6U7w2D9QJ9MOcCWjG8kXa2UIt3CiloYC1IukRsTgdQCOihiU3Nmzbw6/gQS+l/9rmOE6uJFI=</SignatureValue>
            <KeyInfo>
                <X509Data>
                    <X509Certificate>MIIFrDCCBJSgAwIBAgIEQeRwIDANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJicjETMBEGA1UEChMKSUNQLUJyYXNpbDEgMB4GA1UECxMXQ2FpeGEgRWNvbm9taWNhIEZlZGVyYWwxFDASBgNVBAMTC0FDIENBSVhBIFBKMB4XDTEwMTEwNTE4Mzc0MFoXDTExMTAzMDIzNTkwMFowgY0xCzAJBgNVBAYTAmJyMRMwEQYDVQ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2NhaXhhL0FDQ0FJWEFQSjEuY3JsMHKgcKBupGwwajELMAkGA1UEBhMCYnIxEzARBgNVBAoTCklDUC1CcmFzaWwxIDAeBgNVBAsTF0NhaXhhIEVjb25vbWljYSBGZWRlcmFsMRQwEgYDVQQDEwtBQyBDQUlYQSBQSjEOMAwGA1UEAxMFQ1JMODQwHwYDVR0jBBgwFoAUjkAvCv4T1ao5oHZ0htO8fcfx5c8wCQYDVR0TBAIwADAZBgkqhkiG9n0HQQAEDDAKGwRWNy4xAwIDqDANBgkqhkiG9w0BAQUFAAOCAQEAmxyEL1rwIm3FCROzH85Ul4d+6ka/eTIix3TjPbFBnDcvTUrCUW01GEnVyoLQXerQxczutISb+wCRbF0DyliuxVKRgODzCTZQSCQ+tqfPfqDLmCbwk3F3KjLz+A8G1v99H6L6kdY0P3d3MzySQodOfYmhQoxUWQfXegXCne8wBUaWk+3kFjRFVvE6YmztxrvaUV00v3jf2/blQxSfTf3YrKSvwRXm5+fy3sy+CUO6+TJ4HY0mWw2bQDpZDJpj9e/iLTh/TXxYgTeWpUgXmBDSmsWgXVXLfTzGTzI5woITSSLvGkOJdDRkwbpp0lnW6CVSyq+RHeJNK+3dtu8IvpHx8g==</X509Certificate>
                </X509Data>
            </KeyInfo>
        </Signature>
    </evento>
</envEvento>

Service WSDL

<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento">
    <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento">
            <s:element name="nfeDadosMsg">
                <s:complexType mixed="true">
                    <s:sequence>
                        <s:any/>
                    </s:sequence>
                </s:complexType>
            </s:element>
            <s:element name="nfeRecepcaoEventoResult">
                <s:complexType mixed="true">
                    <s:sequence>
                        <s:any/>
                    </s:sequence>
                </s:complexType>
            </s:element>
            <s:element name="nfeCabecMsg" type="tns:nfeCabecMsg"/>
            <s:complexType name="nfeCabecMsg">
                <s:sequence>
                    <s:element minOccurs="0" maxOccurs="1" name="versaoDados" type="s:string"/>
                    <s:element minOccurs="0" maxOccurs="1" name="cUF" type="s:string"/>
                </s:sequence>
                <s:anyAttribute/>
            </s:complexType>
        </s:schema>
    </wsdl:types>
    <wsdl:message name="nfeRecepcaoEventoSoapIn">
        <wsdl:part name="nfeDadosMsg" element="tns:nfeDadosMsg"/>
    </wsdl:message>
    <wsdl:message name="nfeRecepcaoEventoSoapOut">
        <wsdl:part name="nfeRecepcaoEventoResult" element="tns:nfeRecepcaoEventoResult"/>
    </wsdl:message>
    <wsdl:message name="nfeRecepcaoEventonfeCabecMsg">
        <wsdl:part name="nfeCabecMsg" element="tns:nfeCabecMsg"/>
    </wsdl:message>
    <wsdl:portType name="RecepcaoEventoSoap">
        <wsdl:operation name="nfeRecepcaoEvento">
            <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
                Serviço destinado à recepção de mensagem de Evento da NF-e.
            </wsdl:documentation>
            <wsdl:input message="tns:nfeRecepcaoEventoSoapIn"/>
            <wsdl:output message="tns:nfeRecepcaoEventoSoapOut"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="RecepcaoEventoSoap" type="tns:RecepcaoEventoSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="nfeRecepcaoEvento">
            <soap:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento/nfeRecepcaoEvento" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
                <soap:header message="tns:nfeRecepcaoEventonfeCabecMsg" part="nfeCabecMsg" use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="RecepcaoEventoSoap12" type="tns:RecepcaoEventoSoap">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="nfeRecepcaoEvento">
            <soap12:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento/nfeRecepcaoEvento" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
                <soap12:header message="tns:nfeRecepcaoEventonfeCabecMsg" part="nfeCabecMsg" use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="RecepcaoEvento">
        <wsdl:port name="RecepcaoEventoSoap" binding="tns:RecepcaoEventoSoap">
            <soap:address location="https://www.nfe.fazenda.gov.br/RecepcaoEvento/RecepcaoEvento.asmx"/>
        </wsdl:port>
        <wsdl:port name="RecepcaoEventoSoap12" binding="tns:RecepcaoEventoSoap12">
            <soap12:address location="https://www.nfe.fazenda.gov.br/RecepcaoEvento/RecepcaoEvento.asmx"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

Can anyone help me understand the error please?

    
asked by anonymous 09.11.2015 / 15:44

1 answer

0

I was able to find the solution, such as the RS example I should:

  • Using the namespace in the signature tag
  • Have used the URI in the Reference tag with the id # [id of the infEvento tag]
  • The Signature tag should be within an event, not an event.

In this way it works, remembering that only the national environment accepts this type of event.

    
10.11.2015 / 03:06