问题标签 [wcf-routing]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
565 浏览

wcf - 使用 RoutingService 与 nginx 的 WCF .NET Web 服务负载平衡

我目前正在评估具有负载平衡的 WCF Webservice HA 解决方案。对于我正在创作的 WS 类型,我看到了 2 种可行的方法,它们是

1) 使用 .NET 提供的 RoutingService API / 类 2) 使用像 nginx 这样的 HTTP 负载均衡器。

对于托管在 IIS 上的 WCF WS,哪一个是更好的方法。

0 投票
0 回答
171 浏览

wcf - 带有消息签名的 WCF 路由导致加密错误

我在尝试将 WCF 路由引入包含两个启用了消息安全的目标服务端点的项目时遇到问题。(仅签名 - 不加密)我设置了两个简单的基于操作的过滤器,它们直接指向一个服务或另一个。

从我的客户端调用 RoutingService 会在跟踪日志中显示以下错误消息:

The 'Body', 'http://www.w3.org/2003/05/soap-envelope' required message part was not encrypted.

我在服务接口上设置了 ProtectionLevel.Sign,所以我很难理解为什么这是一个问题。

任何人都可以提供的任何帮助将不胜感激。

WCF 服务项目配置

服务

绑定

服务行为

过滤器

服务端客户端

端点行为

WCF 客户端项目配置

客户端客户端

绑定

行为

0 投票
0 回答
48 浏览

wcf - wcf routing - how to edit config file programatically at runtime

I'm trying to build a core with the routing service technology (in wcf .net) that discover its clients automatically with DiscoveryService and then write them into the config file with specific filters so that the core will be able to route messages between the clients.

I succeeded to discover the clients with DiscoveryService, but i'm trying to open new config file with the RoutingConfiguration object, and add the new endpoints I discovered through the RoutingConfiguration.filterTable property but it doesn't work. I also tried to look for examples in other sites but i didn't find anything similar.

I don't know if i'm making a mistake, or if I didn't understand well how to open new configuration file and edit it at runtime programatically.

0 投票
1 回答
680 浏览

c# - 如何根据消息内容将 WCF 服务调用重定向到不同的操作

我在 WCF 服务中有一个操作(方法)。该操作有一个Json内容的参数。

对于这个参数 AuditLineUpdatedModel,我创建了一个预定义类,使用 DataContractAttributes 和 DataMemberAttributes 在反序列化期间将 json 消息映射到对象。

但是,我有一个问题是客户端在相同的字段名称下具有不同的 Json 消息结构,我无法将所有案例组合在一个类中。换句话说,Json 消息有一个可能有不同结构(不是值)的字段;因此,我试图将调用定向到可以满足 Json 消息多样性的不同操作。

到目前为止,我发现 WCF 提供了服务级别的路由。我想知道是否可以在操作级别路由呼叫。换句话说,我有一个服务,其中包含两个不同参数类型的操作。是否可以捕捉呼叫并检查消息内容,然后根据消息将呼叫引导到适当的操作?

为了您的信息,我尝试了 WCF 的IDispatchMessageInspector(消息检查器功能)。我能够检查消息内容,但无法重定向或更改目标(到 uri)地址。 注意:此外,客户端服务无法针对两种不同的情况发送不同的 uri 请求。

0 投票
2 回答
568 浏览

c# - WCF路由如何以编程方式添加备份列表

我正在使用 WCF 路由服务并且我正在尝试实现故障转移,我需要以编程方式添加过滤表备份列表,这是一个示例配置:

我能够添加我在这个问题中找到的示例 FilterTable

这是我的代码片段:

所以在我的场景中ServiceOperation2并且ServiceOperation3是备份端点,我做了很多研究我找不到以编程方式添加备份列表的方法

任何想法如何将备份列表添加到 filterTable?