麻烦WCF与NetTcpBinding的工作 [英] Trouble getting WCF to work with netTcpBinding

查看:138
本文介绍了麻烦WCF与NetTcpBinding的工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的app.config

Below is my app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="Indexer">
        <endpoint address="net.tcp://localhost:8000/Indexer/" binding="netTcpBinding"
          bindingConfiguration="TransactionalTCP" contract="Me.IIndexer" />
      </service>
      <service name = "Indexer" behaviorConfiguration = "MEXGET">
        <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:8000/"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name = "MEXGET">
          <serviceMetadata httpGetEnabled = "true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <netTcpBinding>
        <binding name="TransactionalTCP"
           transactionFlow="true"
         />
      </netTcpBinding>
    </bindings>
  </system.serviceModel>
</configuration>

由于某些原因,我不能去,我跑这个机器上的WCF服务。 任何一个可以发现这个错误吗?我有NetTcpBinding的服务和运行。

For some reason, I cannot get to the WCF service on the machine where I run this. Can any one spot the error? I have netTcpBinding service up and running.

在我有同样运行在HTTP这是工作的罚款与以下config文件

When I had the same running in HTTP it was working fine with the following .config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="IndexerServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:8080/Indexer/"/>
          <serviceDebug includeExceptionDetailInFaults="True" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="Indexer" behaviorConfiguration="IndexerServiceBehavior">
        <endpoint address="http://localhost:8080/Indexer/" binding="basicHttpBinding"
            bindingConfiguration="" name="HTTP" contract="IIndexer" />
        <endpoint address="http://localhost:8080/Indexer/MEX/" binding="mexHttpBinding"
            bindingConfiguration="" name="MEX" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

我真的不能找出我做错了。

I can't really figure out what I'm doing wrong..

推荐答案

您,当然,打开了防火墙,让它听?

You have, of course, opened up the firewall to let it listen?

如果它的任何使用,这里的结合我成功地用不是很久以前:

If it's any use, here's the binding I successfully used not so long ago:

<services>

  <service name="MyService.MySearch" behaviorConfiguration="ServiceBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="http://mypc:8003/MyService"/>
      </baseAddresses>
    </host>
    <endpoint bindingConfiguration="Binding1"
              binding="netTcpBinding"
              contract="MyService.IMySearch"
              address="net.tcp://mypc:8004/MyService"  />
  </service>
</services>
<bindings>
  <netTcpBinding>
    <binding name="Binding1"
             hostNameComparisonMode="StrongWildcard"
             sendTimeout="00:10:00"
             maxReceivedMessageSize="65536"
             transferMode="Buffered"
             portSharingEnabled="false">
      <security mode="None">
        <transport clientCredentialType="None" />
        <message clientCredentialType="None" />
      </security>
    </binding>
  </netTcpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
    </behavior>
  </serviceBehaviors>
</behaviors>

有上没有安全性这一具有约束力。

There's no security on this binding.

这篇关于麻烦WCF与NetTcpBinding的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆