<?xml version='1.0' encoding='UTF-8'?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.publica.inf.br/dir" xmlns="http://www.publica.inf.br/dir" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" attributeFormDefault="unqualified">

    <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema20020212.xsd"></xsd:import>

    <xsd:simpleType name="tsVersao">
        <xsd:restriction base="xsd:token">
            <xsd:pattern value="[1-9]{1}[0-9]{0,1}\.[0-9]{2}"></xsd:pattern>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsUf">
        <xsd:restriction base="xsd:string">
            <xsd:length value="2" fixed="true"></xsd:length>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsCep">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="8"></xsd:maxLength>
            <xsd:pattern value="[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"></xsd:pattern>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsRazaoSocial">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="115"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsAliquota">
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="5"></xsd:totalDigits>
            <xsd:fractionDigits value="4"></xsd:fractionDigits>
            <xsd:minInclusive value="0"></xsd:minInclusive>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsSerieDir">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="5"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsTipoDir">
        <xsd:restriction base="xsd:int">
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsNumeroDir">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="15"></xsd:totalDigits>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="tcContato">
        <xsd:sequence>
            <xsd:element name="Telefone" type="tsTelefone" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Email" type="tsEmail" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="tsEmail">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="100"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsTelefone">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="20"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsBairro">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="100"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsCpf">
        <xsd:restriction base="xsd:string">
            <xsd:length value="11" fixed="true"></xsd:length>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsCodigoMunicipioIbge">
        <xsd:restriction base="xsd:int">
            <xsd:totalDigits value="7"></xsd:totalDigits>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsNumeroEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="10"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsDiscriminacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="10000"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsInformacoesComplementares">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="2000"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsValor">
        <xsd:restriction base="xsd:decimal">
            <xsd:totalDigits value="15"></xsd:totalDigits>
            <xsd:fractionDigits value="2" fixed="true"></xsd:fractionDigits>
            <xsd:minInclusive value="0"></xsd:minInclusive>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsItemListaServico">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="5"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsComplementoEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="60"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsSimNao">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2"></xsd:pattern>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsCnpj">
        <xsd:restriction base="xsd:string">
            <xsd:length value="14" fixed="true"></xsd:length>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsNumeroLote">
        <xsd:restriction base="xsd:nonNegativeInteger">
            <xsd:totalDigits value="10"></xsd:totalDigits>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsQuantidadeDir">
        <xsd:restriction base="xsd:int">
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsEndereco">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="125"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>
    
    <xsd:simpleType name="tsCodigoDir">
        <xsd:restriction base="xsd:int">
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="tcIdentificacaoTomador">
        <xsd:sequence>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="tsIdTag">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"></xsd:maxLength>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsMotivoCancelamentoDir">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"></xsd:maxLength>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsCodigoCancelamentoDir">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="tcInfDir">
        <xsd:sequence>
            <xsd:element name="IdentificacaoDir" type="tcIdentificacaoDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="DataEmissao" type="xsd:dateTime" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="DataDeclaracao" type="xsd:dateTime" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="NaturezaOperacao" type="tsNaturezaOperacao" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Competencia" type="xsd:gYearMonth" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Status" type="tsStatusDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="OutrasInformacoes" type="tsOutrasInformacoes" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Servico" type="tcDadosServico" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Tomador" type="tcDadosTomador" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Prestador" type="tcDadosPrestador" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"></xsd:attribute>
    </xsd:complexType>

    <xsd:element name="EnviarLoteDirEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="LoteDir" type="tcLoteDir"></xsd:element>
                <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:complexType name="tcCpfCnpj">
        <xsd:choice>
            <xsd:element name="Cpf" type="tsCpf" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:choice>
    </xsd:complexType>

    <xsd:complexType name="tcLoteDir">
        <xsd:sequence>
            <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="QuantidadeDir" type="tsQuantidadeDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="ListaDir" minOccurs="1" maxOccurs="1">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="Dir" maxOccurs="unbounded" type="tcDir" minOccurs="1"></xsd:element>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"></xsd:attribute>
        <xsd:attribute name="versao" type="tsVersao" use="required"></xsd:attribute>
    </xsd:complexType>

    <xsd:complexType name="tcIdentificacaoDir">
        <xsd:sequence>
            <xsd:element name="Numero" type="tsNumeroDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Serie" type="tsSerieDir" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Tipo" type="tsTipoDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Codigo" type="tsCodigoDir" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"></xsd:attribute>
    </xsd:complexType>

    <xsd:complexType name="tcDir">
        <xsd:sequence>
            <xsd:element name="InfDir" type="tcInfDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="DirCancelamento" type="tcCancelamentoDir" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="tcCancelamentoDir">
        <xsd:sequence>
            <xsd:element name="Confirmacao" type="tcConfirmacaoCancelamento" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element ref="dsig:Signature" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="tcConfirmacaoCancelamento">
        <xsd:sequence>
            <xsd:element name="Pedido" type="tcPedidoCancelamento" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="DataHoraCancelamento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"></xsd:attribute>
    </xsd:complexType>
    
    <xsd:complexType name="tcPedidoCancelamento">
        <xsd:sequence>
            <xsd:element name="InfPedidoCancelamento" type="tcInfPedidoCancelamento" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>    
    
    <xsd:complexType name="tcInfPedidoCancelamento">
        <xsd:sequence>
            <xsd:element name="IdentificacaoDir" type="tcIdentificacaoDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="CodigoCancelamento" type="tsCodigoCancelamentoDir" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="MotivoCancelamento" type="tsMotivoCancelamentoDir" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"></xsd:attribute>
    </xsd:complexType>
        
    <xsd:complexType name="tcIdentificacaoPrestador">
        <xsd:sequence>
            <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:sequence>
        <xsd:attribute name="id" type="tsIdTag"></xsd:attribute>
    </xsd:complexType>

    <xsd:complexType name="tcValores">
        <xsd:sequence>
            <xsd:element name="ValorServicos" type="tsValor" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorDeducoes" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorPis" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorCofins" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorInss" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorIr" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorCsll" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="IssRetido" type="tsSimNao" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorIss" type="tsValor" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorIssRetido" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="OutrasRetencoes" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="BaseCalculo" type="tsValor" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Aliquota" type="tsAliquota" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorLiquido" type="tsValor" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="DescontoIncondicionado" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="DescontoCondicionado" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="ValorProdutos" type="tsValor" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="tcEndereco">
        <xsd:sequence>
            <xsd:element name="Endereco" type="tsEndereco" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Numero" type="tsNumeroEndereco" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Complemento" type="tsComplementoEndereco" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Bairro" type="tsBairro" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Uf" type="tsUf" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="Cep" type="tsCep" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="CodigoPais" type="tsCodigoPaisBacen" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="tcDadosServico">
        <xsd:sequence>
            <xsd:element name="Valores" type="tcValores" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="ItemListaServico" type="tsItemListaServico" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Discriminacao" type="tsDiscriminacao" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="InformacoesComplementares" type="tsInformacoesComplementares" minOccurs="0" maxOccurs="1"></xsd:element>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="CodigoPais" type="tsCodigoPaisBacen" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="tcDadosTomador">
        <xsd:sequence>
            <xsd:element name="IdentificacaoTomador" type="tcIdentificacaoTomador" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:simpleType name="tsStatusDir">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2"></xsd:pattern>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsNaturezaOperacao">
        <xsd:restriction base="xsd:int">
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="ListaMensagemRetorno">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="MensagemRetorno" type="tcMensagemRetorno" minOccurs="1" maxOccurs="unbounded"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:complexType name="tcMensagemRetorno">
        <xsd:sequence>
            <xsd:element name="Codigo" type="tsCodigoMensagemAlerta" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Correcao" type="tsDescricaoMensagemAlerta" minOccurs="0"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="tsCodigoMensagemAlerta">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsDescricaoMensagemAlerta">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="200"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

 
    <xsd:complexType name="tcIdentificacaoOrgaoGerador">
        <xsd:sequence>
            <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Uf" type="tsUf" minOccurs="1" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="tcDadosPrestador">
        <xsd:sequence>
            <xsd:element name="IdentificacaoPrestador" type="tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Endereco" type="tcEndereco" minOccurs="1" maxOccurs="1"></xsd:element>
            <xsd:element name="Contato" type="tcContato" minOccurs="0" maxOccurs="1"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="tsOutrasInformacoes">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsCodigoVerificacao">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="9"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
            <xsd:whiteSpace value="collapse"></xsd:whiteSpace>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="tsCodigoPaisBacen">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"></xsd:maxLength>
            <xsd:minLength value="1"></xsd:minLength>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="EnviarLoteDirResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"></xsd:element>
                    <xsd:element name="DataRecebimento" type="xsd:dateTime" minOccurs="1" maxOccurs="1"></xsd:element>
                    <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"></xsd:element>
                </xsd:sequence>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>

    <xsd:simpleType name="tsNumeroProtocolo">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="50"></xsd:maxLength>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="ConsultarSituacaoLoteDirEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
	
    <xsd:element name="ConsultarSituacaoLoteDirResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:sequence>
                    <xsd:element name="NumeroLote" type="tsNumeroLote" minOccurs="1" maxOccurs="1"></xsd:element>
                    <xsd:element name="Situacao" type="tsSituacaoLoteDir" minOccurs="1" maxOccurs="1"></xsd:element>
                </xsd:sequence>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>
	
    <xsd:element name="ConsultarLoteDirEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element name="Protocolo" type="tsNumeroProtocolo" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="ConsultarLoteDirResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaDir" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="Dir" maxOccurs="unbounded" type="tcDir" minOccurs="1"></xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="ConsultarDirFaixaEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element name="Faixa" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="DataDeclaracaoInicial" type="xsd:dateTime" minOccurs="1" maxOccurs="1"></xsd:element>
                            <xsd:element name="DataDeclaracaoFinal" type="xsd:dateTime" minOccurs="0" maxOccurs="1"></xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="ConsultarDirFaixaResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaDir" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="Dir" maxOccurs="unbounded" type="tcDir" minOccurs="1"></xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>

    <xsd:simpleType name="tsSituacaoLoteDir">
        <xsd:restriction base="xsd:byte">
            <xsd:pattern value="1|2|3|4"></xsd:pattern>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="ConsultarDirEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element name="IdentificacaoDir" type="tcIdentificacaoDir" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element ref="dsig:Signature" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element> 

    <xsd:element name="ConsultarDirResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaDir" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="Dir" maxOccurs="unbounded" type="tcDir" minOccurs="1"></xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>  
    
    <xsd:element name="CancelarDirEnvio">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="Tomador" type="tcIdentificacaoTomador" minOccurs="1" maxOccurs="1"></xsd:element>
                <xsd:element name="Pedido" type="tcPedidoCancelamento" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="CancelarDirResposta">
        <xsd:complexType>
            <xsd:choice>
                <xsd:element name="ListaDir" minOccurs="1" maxOccurs="1">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="Dir" maxOccurs="unbounded" type="tcDir" minOccurs="1"></xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1"></xsd:element>
            </xsd:choice>
        </xsd:complexType>
    </xsd:element>

</xsd:schema>