<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.betha.com.br/e-nota-contribuinte-ws"
            xmlns="http://www.betha.com.br/e-nota-contribuinte-ws"
            xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
            attributeFormDefault="unqualified"
            elementFormDefault="qualified">
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v01.xsd"/>
<!-- 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.betha.com.br/e-nota-contribuinte-ws"
            xmlns="nfse_betha_v01.xsd"
            xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" attributeFormDefault="unqualified"
            elementFormDefault="qualified">

    <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v01.xsd"/>
 -->
    <!-- definition of simple elements -->
    <xsd:simpleType name="tsVersao">
        <xsd:restriction base="xsd:token">
            <xsd:pattern value="[1-9]{1}[0-9]{0,1}\.[0-9]{0,2}|[1-9]{1}"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroNfse">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoVerificacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="9"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsStatusRps">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsStatusNfse">
        <xsd:restriction base="xsd:int">
            <xsd:pattern value="1|2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNaturezaOperacao">
        <xsd:restriction base="xsd:int">
            <xsd:pattern value="1|2|3|4|5|6|7|8"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCondicao">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="A_VISTA|NA_APRESENTACAO|A_PRAZO|CARTAO_DEBITO|CARTAO_CREDITO|CHEQUE_PRE_DATADO|CHEQUE_A_VISTA|BOLETO_BANCARIO"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsQtdParcela">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsParcela">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsRegimeEspecialTributacao">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsSimNao">
        <xsd:restriction base="xsd:int">
            <xsd:pattern value="1|2|3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsSimNaoNoPattern">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroRps">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroRpsSubstituicao">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsSerieRps">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="5"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsTipoRps">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsOutrasInformacoes">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsValor">
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="15"/>
            <xsd:fractionDigits value="2" fixed="true"/>
            <xsd:minInclusive value="0"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsValorString">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsItemListaServico">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="6"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoCnae">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoTributacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="20"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsAliquota">
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="5"/>
            <xsd:fractionDigits value="4"/>
            <xsd:minInclusive value="0"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsDiscriminacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="2000"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoMunicipioIbge">
        <xsd:restriction base="xsd:string">
            <xsd:length value="7" />
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoMunicipioIbgeTomador">
        <xsd:restriction base="xsd:string">
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsInscricaoMunicipal">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="15"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsInscricaoEstadual">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="15"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsRazaoSocial">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="115"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="tcCpfCnpj">
        <xsd:choice>
            <xsd:element name="Cpf" type="tsCpf" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
        </xsd:choice>
    </xsd:complexType>
    <xsd:complexType name="tcCpfCnpjTomador">
        <xsd:choice>
            <xsd:element name="Cpf" type="tsCpfTomador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Cnpj" type="tsCnpjTomador" minOccurs="1" maxOccurs="1"/>
        </xsd:choice>
    </xsd:complexType>
    <xsd:simpleType name="tsNomeFantasia">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="60"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCnpj">
        <xsd:restriction base="xsd:string">
            <xsd:length value="14" fixed="true"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCnpjTomador">
        <xsd:restriction base="xsd:string">
           <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="125"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="10"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsComplementoEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="60"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsBairro">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="60"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsUf">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="2" />
            <xsd:maxLength value="2" />
            <xsd:whiteSpace value="collapse" />
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsUfTomador">
        <xsd:restriction base="xsd:string">
          <xsd:whiteSpace value="collapse" />
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoPaisBacen">
        <xsd:restriction base="xsd:string">
            <xsd:length value="4" />
            <xsd:whiteSpace value="collapse" />
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCep">
        <xsd:restriction base="xsd:string">
            <xsd:length value="8" />
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCepTomador">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsEmail">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="80" />
            <xsd:whiteSpace value="collapse" />
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsTelefone">
        <xsd:restriction base="xsd:string">
           <xsd:whiteSpace value="collapse" />
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCpf">
        <xsd:restriction base="xsd:string">
            <xsd:length value="11" fixed="true"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCpfTomador">
        <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:simpleType name="tsIndicacaoCpfCnpj">
        <xsd:restriction base="xsd:int">
            <xsd:pattern value="1|2|3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoObra">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="15"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsArt">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="15"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroLote">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsNumeroProtocolo">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="50"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsSituacaoLoteRps">
        <xsd:restriction base="xsd:int">
            <xsd:pattern value="1|2|3|4"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsQuantidadeRps">
        <xsd:restriction base="xsd:string">
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoMensagemAlerta">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsDescricaoMensagemAlerta">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="200"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsCodigoCancelamentoNfse">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tsIdTag">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"/>
        </xsd:restriction>
    </xsd:simpleType>

    <!-- definition of complex elements -->
    <xsd:complexType name="tcEndereco">
        <xsd:all>
            <xsd:element name="Endereco" type="tsEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Numero" type="tsNumeroEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Complemento" type="tsComplementoEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Bairro" type="tsBairro" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Uf" type="tsUf" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoPais" type="tsCodigoPaisBacen" minOccurs="0" maxOccurs="1" />
            <xsd:element name="Cep" type="tsCep" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcEnderecoTomador">
        <xsd:all>
            <xsd:element name="Endereco" type="tsEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Numero" type="tsNumeroEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Complemento" type="tsComplementoEndereco" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Bairro" type="tsBairro" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbgeTomador" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Uf" type="tsUfTomador" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoPais" type="tsCodigoPaisBacen" minOccurs="0" maxOccurs="1" />
            <xsd:element name="Cep" type="tsCepTomador" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcContato">
        <xsd:all>
            <xsd:element name="Telefone" type="tsTelefone" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Email" type="tsEmail" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcContatoTomador">
        <xsd:all>
            <xsd:element name="Telefone" type="tsTelefone" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Email" type="tsEmail" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoOrgaoGerador">
        <xsd:all>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Uf" type="tsUf" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoRps">
        <xsd:all>
            <xsd:element name="Numero" type="tsNumeroRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Serie" type="tsSerieRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Tipo" type="tsTipoRps" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoRpsSubstituicao">
        <xsd:all>
            <xsd:element name="Numero" type="tsNumeroRpsSubstituicao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Serie" type="tsSerieRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Tipo" type="tsTipoRps" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoPrestador">
        <xsd:all>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoTomador">
        <xsd:all>
            <xsd:element name="CpfCnpj" type="tcCpfCnpjTomador" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="InscricaoEstadual" type="tsInscricaoEstadual" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcDadosTomador">
        <xsd:all>
            <xsd:element name="IdentificacaoTomador" type="tcIdentificacaoTomador" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Endereco" type="tcEnderecoTomador" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Contato" type="tcContatoTomador" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoIntermediarioServico">
        <xsd:annotation>
            <xsd:documentation>Representa dados para identificação do intermediário de serviços</xsd:documentation>
        </xsd:annotation>
        <xsd:all>
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1" />
            <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="1" maxOccurs="1" />
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1" />
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcValores">
        <xsd:all>
            <xsd:element name="ValorServicos" type="tsValorString" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ValorDeducoes" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorPis" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorCofins" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorInss" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorIr" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorCsll" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="IssRetido" type="tsValorString" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ValorIss" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorIssRetido" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OutrasRetencoes" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="BaseCalculo" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Aliquota" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ValorLiquidoNfse" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="DescontoIncondicionado" type="tsValorString" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="DescontoCondicionado" type="tsValorString" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcDadosServico">
        <xsd:all>
            <xsd:element name="Valores" type="tcValores" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ItemListaServico" type="tsItemListaServico" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoCnae" type="tsCodigoCnae" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoTributacaoMunicipio" type="tsCodigoTributacao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Discriminacao" type="tsDiscriminacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoPais" type="tsCodigoPaisBacen" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcDadosConstrucaoCivil">
        <xsd:all>
            <xsd:element name="CodigoObra" type="tsCodigoObra" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Art" type="tsArt" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcCondicaoPagamento">
        <xsd:sequence>
            <xsd:element name="Condicao" type="tsCondicao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="QtdParcela" type="tsQtdParcela" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Parcelas" type="tcParcelas" minOccurs="0" maxOccurs="99"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcParcelas">
        <xsd:all>
            <xsd:element name="Parcela" type="tsParcela" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="DataVencimento" type="xsd:string" minOccurs="1" maxOccurs="1" />
            <xsd:element name="Valor" type="tsValor" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcDadosPrestador">
        <xsd:all>
            <xsd:element name="IdentificacaoPrestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="NomeFantasia" type="tsNomeFantasia" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Endereco" type="tcEndereco" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Contato" type="tcContato" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcInfRps">
        <xsd:all>
            <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="DataEmissao" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="NaturezaOperacao" type="tsNaturezaOperacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RegimeEspecialTributacao" type="tsRegimeEspecialTributacao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OptanteSimplesNacional" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IncentivadorCultural" type="tsSimNaoNoPattern" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Status" type="tsStatusRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RpsSubstituido" type="tcIdentificacaoRpsSubstituicao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OutrasInformacoes" type="tsOutrasInformacoes" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Servico" type="tcDadosServico" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Tomador" type="tcDadosTomador" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ConstrucaoCivil" type="tcDadosConstrucaoCivil" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CondicaoPagamento" type="tcCondicaoPagamento" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
        <xsd:attribute name="Id" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="tcRps">
        <xsd:all>
            <xsd:element name="InfRps" type="tcInfRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcIdentificacaoNfse">
        <xsd:all>
            <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcInfNfse">
        <xsd:all>
            <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoVerificacao" type="tsCodigoVerificacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="DataEmissao" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IdentificacaoRps" minOccurs="0" type="tcIdentificacaoRps" maxOccurs="1"/>
            <xsd:element name="DataEmissaoRps" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="NaturezaOperacao" type="tsNaturezaOperacao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="RegimeEspecialTributacao" type="tsRegimeEspecialTributacao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OptanteSimplesNacional" type="tsSimNao" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="IncentivadorCultural" type="tsSimNao" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Competencia" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="NfseSubstituta" type="tsNumeroNfse" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OutrasInformacoes" type="tsOutrasInformacoes" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="Servico" type="tcDadosServico" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ValorCredito" type="tsValor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="PrestadorServico" type="tcDadosPrestador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="TomadorServico" type="tcDadosTomador" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="OrgaoGerador" type="tcIdentificacaoOrgaoGerador" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ConstrucaoCivil" type="tcDadosConstrucaoCivil" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="CondicaoPagamento" type="tcCondicaoPagamento" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
        <xsd:attribute name="Id" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="tcNfse">
        <xsd:sequence>
            <xsd:element name="InfNfse" type="tcInfNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="2"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcInfPedidoCancelamento">
        <xsd:all>
            <xsd:element name="IdentificacaoNfse" type="tcIdentificacaoNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="CodigoCancelamento" type="tsCodigoCancelamentoNfse" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
        <xsd:attribute name="Id" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="tcPedidoCancelamento">
        <xsd:all>
            <xsd:element name="InfPedidoCancelamento" type="tcInfPedidoCancelamento" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcConfirmacaoCancelamento">
        <xsd:all>
            <xsd:element name="Pedido" type="tcPedidoCancelamento" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="DataHoraCancelamento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
        <xsd:attribute name="Id" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="tcCancelamentoNfse">
        <xsd:all>
            <xsd:element name="Confirmacao" type="tcConfirmacaoCancelamento" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcInfSubstituicaoNfse">
        <xsd:all>
            <xsd:element name="NfseSubstituidora" type="tsNumeroNfse" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
        <xsd:attribute name="Id" type="xsd:string"/>
    </xsd:complexType>
    <xsd:complexType name="tcSubstituicaoNfse">
        <xsd:sequence>
            <xsd:element name="SubstituicaoNfse" type="tcInfSubstituicaoNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="2"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="tcCompNfse">
        <xsd:all>
            <xsd:element name="Nfse" type="tcNfse" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="NfseCancelamento" type="tcCancelamentoNfse" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="NfseSubstituicao" type="tcSubstituicaoNfse" minOccurs="0" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcMensagemRetorno">
        <xsd:all>
            <xsd:element name="Codigo" type="tsCodigoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Correcao" type="tsDescricaoMensagemAlerta" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcMensagemRetornoLote">
        <xsd:all>
            <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Codigo" type="tsCodigoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta" minOccurs="1" maxOccurs="1"/>
        </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="tcLoteRps">
        <xsd:all>
            <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="QuantidadeRps" type="tsQuantidadeRps" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ListaRps" minOccurs="1" maxOccurs="1">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="Rps" maxOccurs="unbounded" type="tcRps" minOccurs="1">
                        </xsd:element>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:all>
        <xsd:attribute name="Id" type="xsd:string"/>
        <xsd:attribute name="versao" type="tsVersao" />
    </xsd:complexType>

    <!-- definition of elements -->
    <xsd:element name="ListaMensagemRetorno">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="MensagemRetorno" type="tcMensagemRetorno" minOccurs="1" maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="EnviarLoteRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="DataRecebimento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="EnviarLoteRpsEnvio">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="LoteRps" type="tcLoteRps"/>
                <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarSituacaoLoteRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"/>
                    <xsd:element name="Situacao" type="tsSituacaoLoteRps" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarSituacaoLoteRpsEnvio">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarNfseRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="CompNfse" type="tcCompNfse" minOccurs="1" maxOccurs="1"/>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarNfseRpsEnvio">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarNfseResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="CompNfse" maxOccurs="unbounded" type="tcCompNfse" minOccurs="0"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarNfseEnvio">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="NumeroNfse" type="tsNumeroNfse" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="PeriodoEmissao" minOccurs="0" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:all>
                            <xsd:element name="DataInicial" type="xsd:date" minOccurs="1" maxOccurs="1"/>
                            <xsd:element name="DataFinal" type="xsd:date" minOccurs="1" maxOccurs="1"/>
                        </xsd:all>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="IntermediarioServico" type="tcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarLoteRpsResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="CompNfse" maxOccurs="unbounded" type="tcCompNfse" minOccurs="1"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarLoteRpsEnvio">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"/>
                <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="CancelarNfseResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="Cancelamento" type="tcCancelamentoNfse"/>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="CancelarNfseEnvio">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="Pedido" type="tcPedidoCancelamento"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ConsultarTaxasDiversasEnvio">
        <xsd:complexType>
            <xsd:all>
                <xsd:element name="Prestador" type="tcIdentificacaoPrestador"/>
                <xsd:element name="Protocolo" type="tsNumeroProtocolo"/>
            </xsd:all>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>
