На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
  
> WCF TCP соеденение , не получается
    здравствуите господа

    сделал приложение. автоматом конфиги сгенерилис с wsHttpBinding-ом. тепер наступило время испытать все в сети, и началис проблемы.
    1. при wsHttpBinding-е в сети конектится не получается, чтото там с правами/доступами. то ошибка 10060, то 10061. но в принципе это так, интересно как решить, на будущее.
    2. главное. нужно чтобы система работала с netTcpBinding-ом. но ничего не получается. вот конфиги
    ExpandedWrap disabled
      <?xml version="1.0" encoding="utf-8" ?>
      <configuration>
        <system.serviceModel>
          <behaviors>
            <serviceBehaviors>
              <behavior name="HockshopAutentification.AutentificationServiceBehavior">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="true" />
              </behavior>
            </serviceBehaviors>
          </behaviors>
          <services>
            <service
              behaviorConfiguration="HockshopAutentification.AutentificationServiceBehavior"
                name="HockshopAutentification.AutentificationService">
              <endpoint
                address=""
                binding="wsHttpBinding"
                contract="HockshopAutentification.IAutentificationService">
                <identity>
                  <dns value="localhost" />
                </identity>
              </endpoint>
              <!--<endpoint
                address="net.tcp://localhost:55555/AutentificationService/"
                binding="netTcpBinding"
                contract="HockshopAutentification.IAutentificationService"
                bindingConfiguration = "Unsecured">
                <identity>
                  <dns value="localhost" />
                </identity>
              </endpoint>-->
              <endpoint
              address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange" >
              </endpoint>
              <host>
                <baseAddresses>
                  <add baseAddress="http://localhost:8731/Design_Time_Addresses/HockshopAutentification/AutentificationService/" />
                </baseAddresses>
              </host>
            </service>
          </services>
          <!--<bindings>
            <netTcpBinding>
              <binding name="Unsecured">
                <security mode="None"></security>
              </binding>
            </netTcpBinding>
          </bindings>-->
        </system.serviceModel>
      </configuration>

    ExpandedWrap disabled
      <?xml version="1.0"?>
      <configuration>
        <system.serviceModel>
          <bindings>
            <wsHttpBinding>
              <binding name="WSHttpBinding_IAutentificationService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
                textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                  maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:10:00"
                  enabled="false" />
                <security mode="Message">
                  <transport clientCredentialType="Windows" proxyCredentialType="None"
                    realm="" />
                  <message clientCredentialType="Windows" negotiateServiceCredential="true"
                    algorithmSuite="Default" establishSecurityContext="true" />
                </security>
              </binding>
            </wsHttpBinding>
          </bindings>
          <client>
            <endpoint address="http://localhost:8731/Design_Time_Addresses/HockshopAutentification/AutentificationService/"
              binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAutentificationService"
              contract="AutentificationServiceServiceReference.IAutentificationService"
              name="WSHttpBinding_IAutentificationService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <!--<endpoint address="net.tcp://localhost:55555/AutentificationService/"
              binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IAutentificationService"
              contract="AutentificationServiceServiceReference.IAutentificationService"
              name="NetTcpBinding_IAutentificationService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>-->
          </client>
          <!--<bindings>
            <netTcpBinding>
              <binding name="Unsecured">
                <security mode="None"></security>
              </binding>
            </netTcpBinding>
          </bindings>-->
        </system.serviceModel>
      </configuration>

    помогите люди добрые, кто чем может :)

    спосибо
      Цитата Kobra @
      1. при wsHttpBinding-е в сети конектится не получается, чтото там с правами/доступами. то ошибка 10060, то 10061. но в принципе это так, интересно как решить, на будущее.

      Эти ошибки обычно вылетают когда соединение рубит firewall.

      Цитата Kobra @
      2. главное. нужно чтобы система работала с netTcpBinding-ом. но ничего не получается. вот конфиги

      Проверь, в твоем конфиге на клиенте указано bindingConfiguration="NetTcpBinding_IAutentificationService" тогда как конфигурация на самом деле названа <binding name="Unsecured">
      А вообще неплохо было бы иметь еще и текст ошибки, в WCF они очень информативные. Если ошибка возникает на стороне сервера, можно включить трассировку как показано здесь: Service Trace Viewer Tool
        Цитата spicard @
        Эти ошибки обычно вылетают когда соединение рубит firewall.
        извеняюс, забыл укозать:
        firewall отклучен. а когда вклучаю, то настраиваю :)
        Цитата spicard @
        А вообще неплохо было бы иметь еще и текст ошибки, в WCF они очень информативные.
        мнеб до этого доити. вот как до этого доиду, сразу пропишу чтоб открил отладчик. с netTcpBinding-ом даже локално конекта нет. так что ответа с сервера ждать не приходится. а чаще вообше програма не запускается. а что до названия, таких я понаписал не менше сотни, какую выложил хрен знает. :) приду домои проверью
        а что все осталное правилно?
          Тут изменить
          Цитата
          <add baseAddress="http://localhost:8731/Design_Time_Addresses/HockshopAutentification/AutentificationService/" />

          И на клиенте изменить wsHttpBinding на netTcpBinding
            spicard, GarF1eld спосибо. вроде получилос. но что и как, так и не понял :)
            вот с такими конфигами заработала в виртуалной сети
            ExpandedWrap disabled
              <?xml version="1.0" encoding="utf-8" ?>
              <configuration>
                <configSections>
                </configSections>
                <system.serviceModel>
                  <behaviors>
                    <serviceBehaviors>
                      <behavior name="HockshopAutentification.AutentificationServiceBehavior">
                        <serviceMetadata httpGetEnabled="true" />
                        <serviceDebug includeExceptionDetailInFaults="true" />
                      </behavior>
                    </serviceBehaviors>
                  </behaviors>
                  <services>
                    <service
                      behaviorConfiguration="HockshopAutentification.AutentificationServiceBehavior"
                        name="HockshopAutentification.AutentificationService">
                      <endpoint
                        address=""
                        binding="wsHttpBinding"
                        contract="HockshopAutentification.IAutentificationService">
                        <identity>
                          <dns value="localhost" />
                        </identity>
                      </endpoint>
                      <endpoint
                        address=""
                        binding="netTcpBinding"
                        contract="HockshopAutentification.IAutentificationService"
                        bindingConfiguration = "Unsecured">
                        <identity>
                          <dns value="localhost" />
                        </identity>
                      </endpoint>
                      <host>
                        <baseAddresses>
                          <add baseAddress="http://localhost:8731/Design_Time_Addresses/HockshopAutentification/AutentificationService/" />
                          <add baseAddress="net.tcp://localhost:55555/Design_Time_Addresses/HockshopAutentification/AutentificationService/" />
                        </baseAddresses>
                      </host>
                    </service>
                  </services>
                  <bindings>
                    <netTcpBinding>
                      <binding
                        name="Unsecured">
                        <security
                          mode="None">            
                        </security>
                      </binding>
                    </netTcpBinding>
                  </bindings>
                </system.serviceModel>
              </configuration>

            ExpandedWrap disabled
              <?xml version="1.0"?>
              <configuration>
                <configSections>
                </configSections>
                 <startup>
                  <supportedRuntime version="v2.0.50727" />
                </startup>
                <system.serviceModel>
                  <bindings>
                    <netTcpBinding>
                      <binding name="NetTcpBinding_IAutentificationService" 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" />
                          <message clientCredentialType="Windows" />
                        </security>
                      </binding>
                    </netTcpBinding>
                  </bindings>
                  <client>
                    <endpoint address="net.tcp://192.168.1.80:55555/Design_Time_Addresses/HockshopAutentification/AutentificationService/"
                      binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IAutentificationService"
                      contract="AutentificationServiceServiceReference.IAutentificationService"
                      name="NetTcpBinding_IAutentificationService">
                      <identity>
                        <dns value="192.168.1.1" />
                      </identity>
                    </endpoint>
                  </client>
                </system.serviceModel>
              </configuration>

            тепер буду пробовать в инете
            0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
            0 пользователей:


            Рейтинг@Mail.ru
            [ Script execution time: 0,0263 ]   [ 16 queries used ]   [ Generated: 4.05.24, 01:28 GMT ]