wcf - WCF 4 服务的平面 WSDL

标签 wcf wsdl wcf-4

使用 WCF 3.5 和 FlatWsdl EndpointBehavior from Christian Weyer ,我能够在没有任何 <import> 的情况下为我的 WCF 服务获取单个平面 WSDL 文件指令。

现在使用 WCF 4,由于某种原因,这不再起作用。

我已经尝试了很多博客文章中描述的所有内容,包括使用 WcfExtras行为扩展。

他们都指的是Chr。 Weyers 解决方案或推荐 WcfExtras。
我还确保为绑定(bind)、ServiceContract 和 ServiceBehavior 指定了相同的命名空间。

在自定义服务宿主中,当即将注入(inject) FlatWsdlExtension 时,Description.Endpoints 集合始终为空。我尝试使用或不使用地址配置我的服务端点,到目前为止没有运气。

我需要做什么才能为我的 WCF 4 服务获取单个平面 WSDL?

感谢您的任何回答。

最佳答案

我有这个准确 问题。今天经过几次尝试,我终于通过执行以下操作使其工作:

Read this blog post in full.

Make sure you specify exactly the same namespace attribute in: ServiceContract, ServiceBehavior, and bindingNamespace (.config->services/service/endpoint section).

Be mindful of this problem, which I did encounter at one point.

Download this zip file and include FlatWsdl/Extensions: FlatWsdl.cs, FlatWsdlServiceHost.cs, and FlatWsdlServiceHostFactory.cs somewhere in your project.

Make sure you specify the fully-qualified classname for your version of FlatWsdlServiceHostFactory.cs (minus .cs of course) in the ServiceHost Factory attribute of your .svc file.


我今天尝试了 WcfExtras 以及其他一些东西——它可能或多或少,但这些步骤最终让我走了。祝你好运!
[编辑]

关于wcf - WCF 4 服务的平面 WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5801128/

相关文章:

c# - 如何使用具有相同契约(Contract)和绑定(bind)的动态端点创建多个 wcf 服务实例而不保存在 app.config 中?

PHP SOAP 头构造

c# - 有效关闭 WCF 4 channel 的正确方法

c# - WCF 和排队调用

wcf - WSHttpBinding 和 HTTP 和 Windows 身份验证

c# - 在 Internet 上用很少的客户端保护 WCF 服务的最佳方法

web-services - ColdFusion 2016 中的 Web 服务不再起作用

web-services - 向Web服务添加方法:旧客户端是否需要更新Web引用?

wcf - 基本 HTTP 绑定(bind)未正确配置