none
Ajuda para configurar wcf pelo arquivo app.config RRS feed

  • Pergunta

  • Ola Israel, decidi seguir o seu conselho em configurar o meu servidor usando o arquivo de configurações. Porem está acontecendo uma coisa que eu não estou conseguindo entender e nem resolver. A cada vez que eu atualizo a referencia do servidor no cliente, ele duplica todas as configurações dos bindings e endpoint's existentes no arquivo ao inves de atualiza-las veja:

        <system.serviceModel>
            <bindings>
                <netTcpBinding>
                    <binding name="DadosServidor" closeTimeout="00:01:00" openTimeout="00:01:00"
                        receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
                        transferMode="Buffered" transactionProtocol="OleTransactions"
                        hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                        maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                        maxReceivedMessageSize="65536">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="None">
                            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign">
                                <extendedProtectionPolicy policyEnforcement="Never" />
                            </transport>
                            <message clientCredentialType="Windows" />
                        </security>
                    </binding>
                    <binding name="Municipio" closeTimeout="00:01:00" openTimeout="00:01:00"
                        receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
                        transferMode="Buffered" transactionProtocol="OleTransactions"
                        hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                        maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                        maxReceivedMessageSize="65536">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="None">
                            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign">
                                <extendedProtectionPolicy policyEnforcement="Never" />
                            </transport>
                            <message clientCredentialType="Windows" />
                        </security>
                    </binding>
                    <binding name="DadosServidor1" closeTimeout="00:01:00" openTimeout="00:01:00"
                        receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
                        transferMode="Buffered" transactionProtocol="OleTransactions"
                        hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                        maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                        maxReceivedMessageSize="65536">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="None">
                            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign">
                                <extendedProtectionPolicy policyEnforcement="Never" />
                            </transport>
                            <message clientCredentialType="Windows" />
                        </security>
                    </binding>
                    <binding name="Municipio1" closeTimeout="00:01:00" openTimeout="00:01:00"
                        receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
                        transferMode="Buffered" transactionProtocol="OleTransactions"
                        hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                        maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                        maxReceivedMessageSize="65536">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="None">
                            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign">
                                <extendedProtectionPolicy policyEnforcement="Never" />
                            </transport>
                            <message clientCredentialType="Windows" />
                        </security>
                    </binding>
                </netTcpBinding>
            </bindings>
            <client>
                <endpoint address="net.tcp://192.168.10.133:1205/DadosServidor"
                    binding="netTcpBinding" bindingConfiguration="DadosServidor"

                    contract="Servidor.IDadosServidor" name="DadosServidor" />
                <endpoint address="net.tcp://192.168.10.133:1205/Municipio" binding="netTcpBinding"
                    bindingConfiguration="Municipio" contract="Servidor.IMunicipio"

                    name="Municipio" />
                <endpoint address="net.tcp://192.168.10.133:1205/DadosServidor"
                    binding="netTcpBinding" bindingConfiguration="DadosServidor1"

                    contract="Servidor.IDadosServidor" name="DadosServidor1" />
                <endpoint address="net.tcp://192.168.10.133:1205/Municipio" binding="netTcpBinding"
                    bindingConfiguration="Municipio1" contract="Servidor.IMunicipio"

                    name="Municipio1" />
            </client>
        </system.serviceModel>

    Como contornar isto?

    quinta-feira, 1 de abril de 2010 14:14

Todas as Respostas