Error sending Pedidoenviorps XML to Webservice da Prefeitura São Paulo NFS-e

Asked

Viewed 1,080 times

3

I am getting the following error return from Webservice when I try to send XML

    <?xml version="1.0" encoding="UTF-8" ?> 
 <RetornoEnvioRPS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.prefeitura.sp.gov.br/nfe">
 <Cabecalho Versao="1" xmlns="">
  <Sucesso>false</Sucesso> 
  </Cabecalho>
 <Erro xmlns="">
  <Codigo>1001</Codigo> 
  <Descricao>XML não compatível com Schema.The element 'PedidoEnvioRPS' in namespace 'http://www.prefeitura.sp.gov.br/nfe' has invalid child element 'RPS' in namespace 'http://www.prefeitura.sp.gov.br/nfe'. List of possible elements expected: 'RPS'.</Descricao> 
  </Erro>
  </RetornoEnvioRPS>

The sending XML is as follows:

<?xml version="1.0" encoding="UTF-8"?>
    <PedidoEnvioRPS xmlns="http://www.prefeitura.sp.gov.br/nfe" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <Cabecalho xmlns="" Versao="1">   
    <CPFCNPJRemetente>
    <CNPJ>53002458000101</CNPJ>
    </CPFCNPJRemetente>
    </Cabecalho>
        <RPS>
    <Assinatura>UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi</Assinatura>
       <ChaveRPS>
    <InscricaoPrestador>33959249</InscricaoPrestador>
    <SerieRPS>00001</SerieRPS>
    <NumeroRPS>000000000001</NumeroRPS>
    </ChaveRPS>
    <TipoRPS>RPS-M</TipoRPS>
    <DataEmissao>1957-08-13</DataEmissao>
    <StatusRPS>N</StatusRPS>
    <TributacaoRPS>F</TributacaoRPS>
    <ValorServicos>0</ValorServicos>
    <ValorDeducoes>0</ValorDeducoes>
    <CodigoServico>0000</CodigoServico>
    <AliquotaServicos>0</AliquotaServicos>
    <ISSRetido>false</ISSRetido>
       -<CPFCNPJTomador>
    <CPF>13167474254</CPF>
    </CPFCNPJTomador>
    <RazaoSocialTomador>TOMADOR PF</RazaoSocialTomador>
        <EnderecoTomador>
    <TipoLogradouro>Av</TipoLogradouro>
    <Logradouro>Paulista</Logradouro>
    <NumeroEndereco>100</NumeroEndereco>
    <ComplementoEndereco>Cj 35</ComplementoEndereco>
    <Bairro>Bela Vista</Bairro>
    <Cidade>3550308</Cidade>
    <UF>SP</UF>
    <CEP>1310100</CEP>
    </EnderecoTomador>
    <EmailTomador>[email protected]</EmailTomador>
    <Discriminacao>Desenvolvimento de Web Site Pessoal.</Discriminacao>
    </RPS>
    </PedidoEnvioRPS>

I’m working on VB.net.

  • Which web service address you added as a reference in your project?

  • That: https://nfe.prefeitura.sp.gov.br/ws/lotenfe.asmx

1 answer

0

There was a hyphen in your code, I took it out, that could be the problem in the syntax.

<?xml version="1.0" encoding="UTF-8"?>
    <PedidoEnvioRPS xmlns="http://www.prefeitura.sp.gov.br/nfe" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <Cabecalho xmlns="" Versao="1">   
    <CPFCNPJRemetente>
    <CNPJ>53002458000101</CNPJ>
    </CPFCNPJRemetente>
    </Cabecalho>
        <RPS>
    <Assinatura>UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi</Assinatura>
       <ChaveRPS>
    <InscricaoPrestador>33959249</InscricaoPrestador>
    <SerieRPS>00001</SerieRPS>
    <NumeroRPS>000000000001</NumeroRPS>
    </ChaveRPS>
    <TipoRPS>RPS-M</TipoRPS>
    <DataEmissao>1957-08-13</DataEmissao>
    <StatusRPS>N</StatusRPS>
    <TributacaoRPS>F</TributacaoRPS>
    <ValorServicos>0</ValorServicos>
    <ValorDeducoes>0</ValorDeducoes>
    <CodigoServico>0000</CodigoServico>
    <AliquotaServicos>0</AliquotaServicos>
    <ISSRetido>false</ISSRetido>
       <CPFCNPJTomador> <!-- Aqui o erro, tinha um traço antes do CPFCNPJTomador. -->
    <CPF>13167474254</CPF>
    </CPFCNPJTomador>
    <RazaoSocialTomador>TOMADOR PF</RazaoSocialTomador>
        <EnderecoTomador>
    <TipoLogradouro>Av</TipoLogradouro>
    <Logradouro>Paulista</Logradouro>
    <NumeroEndereco>100</NumeroEndereco>
    <ComplementoEndereco>Cj 35</ComplementoEndereco>
    <Bairro>Bela Vista</Bairro>
    <Cidade>3550308</Cidade>
    <UF>SP</UF>
    <CEP>1310100</CEP>
    </EnderecoTomador>
    <EmailTomador>[email protected]</EmailTomador>
    <Discriminacao>Desenvolvimento de Web Site Pessoal.</Discriminacao>
    </RPS>
    </PedidoEnvioRPS>

Browser other questions tagged

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