首页 新闻 搜索 专区 学院

我现在有一个服务部署在不通的端口上,在实现其通过WCF路由来交替调用时,出现了问题,只能调用的一个服务

0
[待解决问题]

我现在有一个服务部署在不通的端口上,在实现其通过WCF路由来交替调用时,出现了问题,只能调用的一个服务;请大家帮忙看看,配置文件如下:

路由端配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>

<services>
<service name="System.ServiceModel.Routing.RoutingService" behaviorConfiguration="RoutingBehaviors">
<endpoint name="nDB2" address="DB2" binding="netTcpBinding" contract="System.ServiceModel.Routing.IRequestReplyRouter" />
<!--使用的是EndpointName-->
<endpoint name="nDB1" address="DB1" binding="netTcpBinding" contract="System.ServiceModel.Routing.IRequestReplyRouter" />
<host>
<baseAddresses>

<add baseAddress="net.tcp://localhost:9002/V1/Routing"/>
</baseAddresses>
</host>
</service>
</services>

<behaviors>
<serviceBehaviors>
<behavior name="RoutingBehaviors">
<serviceDebug includeExceptionDetailInFaults="true"/>

<routing filterTableName="FilterTable1"/>
</behavior>
</serviceBehaviors>
</behaviors>

 

<routing>
<filters>
<filter name="FilterTest" filterType="EndpointName" filterData="nDB1" />
</filters>
<filterTables>
<filterTable name="FilterTable1">
<!--backupList :备份-->
<add endpointName="TestEndpoint" filterName="FilterTest" priority="1" backupList=""/>
<add endpointName="BackupServerA" filterName="FilterTest" priority="2" backupList=""/>
</filterTable>
</filterTables>
<backupLists>
<backupList name="backupA">
<add endpointName="BackupServerA" />
</backupList>
</backupLists>
</routing>

<client>
<endpoint address="net.tcp://localhost:8001/ServiceHost" binding="netTcpBinding" contract="*" name="TestEndpoint"/>

<endpoint address="net.tcp://localhost:8002/ServiceHost" binding="netTcpBinding" contract="*" name="BackupServerA"/>
</client>

</system.serviceModel>
</configuration>

客户端配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>

<client>
<endpoint address="net.tcp://localhost:9002/V1/Routing/DB2" binding="netTcpBinding"
contract="IDuplexSessionRouter"
name="DuplexSessionRouter" />
<endpoint address="net.tcp://localhost:9002/V1/Routing/DB1" binding="netTcpBinding"
contract="ServiceHost.ITest"
name="DB1" />
</client>
</system.serviceModel>
</configuration>

Love-逍遥的主页 Love-逍遥 | 菜鸟二级 | 园豆:202
提问于:2012-08-07 10:20
< >
分享
所有回答(2)
0

你的问题太复杂,估计没人回答你。

Launcher | 园豆:45045 (高人七级) | 2012-08-07 10:44
0

实现其通过WCF路由来交替调用

 

是通过程序来控制的吗?

chenping2008 | 园豆:9836 (大侠五级) | 2012-08-07 11:58

配置的方式可以实现吗?

支持(0) 反对(0) Love-逍遥 | 园豆:202 (菜鸟二级) | 2012-08-07 13:33

@Love-逍遥: 你说的 “出现了问题,只能调用的一个服务”, 你有多个服务,就需要单独的建立多个service配置节点。

支持(0) 反对(0) chenping2008 | 园豆:9836 (大侠五级) | 2012-08-07 20:27
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册