如何开始主持人和使用WcfSvcHost.exe启动具有两个端点的服务

时间:2013-01-12 18:31:56

标签: wcf

我有两个端点的服务。一个端点用于wsdual绑定,另一个端点用于tcp绑定。当我用wcfsvchost.exe启动我的wcf服务时

WcfSvcHost.exe /service:"C:
\Users\TRIDIP\Documents\Visual Studio 2010\Projects\BBAChatService\BBAChatService\bin
\BBAChatService.dll" /config:"C:\Users\TRIDIP\documents\visual studio 2010\Projects
\BBAChatService\BBAChatService\Web.config"

然后我的服务启动但它只显示一个mex端点。它应该显示两个mex端点,因为我在web.config文件中声明了两个端点。这是我的配置文件条目。

<service name="BBAChatService.ChatService" behaviorConfiguration="BBAChatService.ChatServiceBehavior" >
        <host>
          <baseAddresses>
            <add baseAddress ="http://localhost:8732/ChatService.svc/"/>
            <add baseAddress ="net.tcp://localhost:7998/ChatService/"/>
          </baseAddresses>
        </host>

        <endpoint name="dual_bind"
                  address="dual"
                  binding="wsDualHttpBinding" 
                  bindingConfiguration="WSDualHttpBinding_IChatService" 
                  contract="BBAChatService.IChatService">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

        <endpoint name="tcp_bind"
              address="tcp"
              binding="netTcpBinding"
              bindingConfiguration="tcpBinding"
              contract="BBAChatService.IChatService">
        </endpoint>

        <endpoint address="net.tcp://localhost:7996/ChatService/mex"
                          binding="mexTcpBinding"
                          contract="IMetadataExchange"/>


      </service>

配置文件中有什么我想念的。请指导我需要做什么,因此wcfsvchost将为我的服务显示两个不同的端点。感谢

0 个答案:

没有答案
相关问题