Webservice NF Paulistana does not return C#

Asked

Viewed 501 times

1

Dear friends, good afternoon. I have some problems with the use of the webservice of the São Paulo tax bill, where I need to get the Received Tax Notes and bring me this information. I already create the XML file to send in the function call, but it is not returning what I need, always returns something like "Server Internal Error". Apparently the file formatting is correct, but the message is not what it seems. Below the final result of my XML, check if it is correct.

<?xml version="1.0" encoding="utf-8"?>
<p1:PedidoConsultaNFePeriodo xmlns:p1="http://www.prefeitura.sp.gov.br/nfe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Cabecalho Versao="1">
        <CPFCNPJRemetente>
            <CNPJ>00000000000000</CNPJ>
        </CPFCNPJRemetente>
        <CPFCNPJ>
            <CNPJ>00000000000000</CNPJ>
        </CPFCNPJ>
        <Inscricao>00000000</Inscricao>
        <dtInicio>2015-11-01</dtInicio>
        <dtFim>2015-11-30</dtFim>
        <NumeroPagina>1</NumeroPagina>
    </Cabecalho>
    <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="">
                <Transforms>
                    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                    <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                </Transforms>
                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                <DigestValue>9HSKC2wOPMBRcXxM0qqwFUwkveg=</DigestValue>
            </Reference>
        </SignedInfo>
        <SignatureValue>BWEW67Qau/ksFMPstUf5cHBw087/Zs0CPsp1lqTSJCkWlh6HWuXj1yoWnFR/GCiV5/PnzlCFeCRr5yNUEcEMLyjxuYr8HaZ3W0DOOwclCThMvGFUfUtESoSBfhmirai6qPVn9fIlE7jaTnpl4imO0ZIonrCeEJqS9vXjzWZ/c+IknvT4Q8jvYq9y5lJb+vDZzIsr2HHk4HFZYaJFvGHlPeUTVvu8Lf4qveVwIwOdxYqOOSJBXpuj7kS1wuZLKifOORpx4vrazG+Xnl3/fpbZrW5DZGCYDCKY9uGwu8Wy2nhdbpxZMhWmKAf1fHRL8l+yksBN16BUx7yEVZ7G7kUPFg==</SignatureValue>
        <KeyInfo>
            <X509Data>
                <X509Certificate>MIIIaDCCBlCgAwIBAgIQcSqCahEX/0kTWAdZh6tPhDANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJCUjETMBEGA1UEChMKSUNQLUJyYXNpbDEtMCsGA1UECxMkQ2VydGlzaWduIENlcnRpZmljYWRvcmEgRGlnaXRhbCBTLkEuMSEwHwYDVQQDExhBQyBDZXJ0aXNpZ24gTXVsdGlwbGEgRzUwHhcNMTUwNDIyMDAwMDAwWhcNMTYwNDIwMjM1OTU5WjCB6DELMAkGA1UEBhMCQlIxEzARBgNVBAoUCklDUC1CcmFzaWwxODA2BgNVBAsUL0F1dGVudGljYWRvIHBvciBDZXJ0aXNpZ24gQ2VydGlmaWNhZG9yYSBEaWdpdGFsMRswGQYDVQQLFBJBc3NpbmF0dXJhIFRpcG8gQTExFTATBgNVBAsUDElEIC0gODE1NzIyNzEjMCEGA1UEAxMaR0xFTk1BUksgRkFSTUFDRVVUSUNBIExUREExMTAvBgkqhkiG9w0BCQEWIm1pY2hlbGkubWFycXVlc0BnbGVubWFya3BoYXJtYS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCUQoeaum+KeNn+KqewnK2i33qYe4EkMXnNFmOimOHGcO1V/mHr24W1jHn5XuLrgxwPOZSreNG9yOlbwrrWhzvjs11XpC2XP/sHx8kqInMeYTyc7O4hqEaWqkAKurr+NRabgGWtc1NGiwHYk/uTas+lzpu6FjFxYzl50FoaeHzWJtLXksBHBbQ5aID66TFh5STB5tj5VR/dp/WHGGVHlxNL2MCwHuoCyFc9MUhMgYGzfsW8utIjivS5LhS3BzHfR4NCtaZTZ7dlSLniKOzJv0JvAyjq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BAQSBkzCBkDBkBggrBgEFBQcwAoZYaHR0cDovL2ljcC1icmFzaWwuY2VydGlzaWduLmNvbS5ici9yZXBvc2l0b3Jpby9jZXJ0aWZpY2Fkb3MvQUNfQ2VydGlzaWduX011bHRpcGxhX0c1LnA3YzAoBggrBgEFBQcwAYYcaHR0cDovL29jc3AuY2VydGlzaWduLmNvbS5icjANBgkqhkiG9w0BAQsFAAOCAgEAN31h8WSqNQ9p1rm5h0/tv+nDt8rlcrgmkKsS829grfwnwFQnjbqSmYGpL4r/fCZFzZeYaDz+VrQpuiYr44048Fyw7LDVdmChNfGJEMTCjFhD/nm84wZDAZLx+kaRe+fJLWKE7WGUozpdApK9WbjooqajM7WQUPDUBxKHqResdvQ8D/HjBnWcSVPslTE63sq7QMkKqPbvLK5Pelru35r0p3g9UdSdVf+ygubK+0AmTqqjoA284bAoeRGcLiZUO+RMX6qN5AvU14z8XGas3zkBvkwh2GtgaYdcZFB2r6EF7t9dD5R7HsTHijp9qaB/+utOtD5ztboxDdqcO2u8zfI2Jgfu4myBMKi4DxLtPSC5ojPN4AmsEOgXKjY8mN32LvEPH+Y9hsBVwIYrxgnNn8MohF9/hGn+gXuA4XDRMDEWtXokIipjlfUz1G01AzrxJXpkrDrMxtDixp/X692GWtXk+tKndBEk9tEHh9wx9vaHf1pubSFtfGHzAlcDc23LFU6iqHJBM4iHX5psQPio0yQiG0dWrTT5bTr+VJP0Uu7RuTAxk6n7O1L8crUP4jbO7e/dEmk14BZACA9NDTmejjBhDq4dPap0GLSisX02zv3xiNhqvTUxaXwyIoUF1yqf+1J5P78Zp0DCjiIuJ2xsR+rpXH4kTf/ufs0Kdy0mA5DZgz4=</X509Certificate>
            </X509Data>
        </KeyInfo>
    </Signature>
</p1:PedidoConsultaNFePeriodo>

To send carry out the POST, I use the HTTP schema, so I do not know if you need to change something there too.

Can someone please help me?

Thank you in advance.

  • The error you are indicating is too wide and indicates problem on the server. Have you made contact with the institution you send to give you a position on what might be going on? The error occurs exactly in the method you make the request by sending your file?

  • Solved? Probably the value of the signature and the value of <Cpfcnpjremetente>. What is Soapaction?

No answers

Browser other questions tagged

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