[英]WCF RoutingService not routing wsDualHttpBinding with callbacks
我在使用 .Net 4.0 路由服务连接到使用回调的服务时遇到问题。 据我了解,路由服务支持绑定和回调。 仅服务和客户端运行良好。
我所做的是获取位于此处的 MS WCF 和 WF 样本: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35ec8682-d5fd-4bc3-a521a-d8
并更改了配置以匹配我的服务的绑定。 我可以通过从客户端到服务的路由服务调用操作,只有从服务到客户端的回调不会被客户端接收到。
路由服务配置如下,使用控制台应用程序作为主机
using (ServiceHost serviceHost =
new ServiceHost(typeof(RoutingService)))
{
serviceHost.Open();
Console.ReadLine();
}
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true" />
</diagnostics>
<services>
<!--ROUTING SERVICE -->
<service behaviorConfiguration="routingData" name="System.ServiceModel.Routing.RoutingService" >
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/routingservice/router"/>
</baseAddresses>
</host>
<endpoint address=""
binding="wsDualHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IRequestReplyRouter"
bindingConfiguration="UnSecureBinding"/>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="routingData">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="true" />
<routing filterTableName="routingTable1" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsDualHttpBinding>
<binding name="UnSecureBinding">
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint name="NotificationService"
address="http://localhost/CommServices/NotificationService.svc"
binding="wsDualHttpBinding"
bindingConfiguration="UnSecureBinding"
contract="*" />
</client>
<!--ROUTING SECTION -->
<routing>
<filters>
<filter name="MatchAllFilter1" filterType="MatchAll" />
</filters>
<filterTables>
<filterTable name="routingTable1">
<add filterName="MatchAllFilter1" endpointName="NotificationService" />
</filterTable>
</filterTables>
如果我启用 ServiceModel 跟踪,我可以在 WCF 堆栈深处看到 ArgumentException,这是迄今为止我没有跟踪的跟踪。
如果我对 RoutingService 回调功能的假设是错误的,任何人都可以给出正确方向的提示,或者纠正我。
TIA & 干杯多米尼克
万一有人像我一样绊倒,问题是路由器端点上的合同。 RequestReplyRouter 不支持回调,但 IDuplexSessionRouter 支持。
<endpoint address=""
binding="wsDualHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IDuplexSessionRouter"
bindingConfiguration="UnSecureBinding"/>
问候多米尼克
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.