WCF FlatWSDL - 如果您的主机是 IIS,您将必要的代码放在哪里?

发布于 2024-11-17 01:55:43 字数 521 浏览 3 评论 0 原文

基本上,在研究获取 FlatWSDL 的解决方案时,我发现了以下内容:

WCF Extras 看起来很有趣,但对于我的需要来说可能太多了(只是一个 FlatWSDL)。因此,第一个链接指出了如何做到这一点,但这就是问题所在。如果您将服务托管在 IIS 中,那么此代码将放在哪里?

Basically, looking into the solutions to get a FlatWSDL, I found the following:

The WCF Extras looks interesting, but might be too much for what I need (which is simply a FlatWSDL). So, the first link points out how to do that, except here's the thing. If you host your service within IIS, where would this code go?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北城挽邺 2024-11-24 01:55:43

我知道这是一个老问题(一年多了!),但由于我今天一直在玩这个问题,我认为值得尝试澄清这个问题......

答案来自这里 http://blogs.msdn.com/b/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx

如该页面所述,您需要创建 3 个类 - FlatWsdlFlatWsdlServiceHostFlatWsdlServiceHostFactory。然后,为了在 IIS 中托管,请将 Factory 类的引用添加到 .svc 标记文件中...

<%@ ServiceHost Language="C#"
  Factory="{YourNamespace}.FlatWsdlServiceHostFactory"
  Service="{YourNamespace}.WcfService1"%>

另外,看起来这将在 WCF 4.5 中得到解决:)
http://blogs.msdn.com/b/piyushjo/archive/2011/10/05/what-s-new-in-wcf-4-5-flat-wsdl-support.aspx< /a>

I know this is an old question (over a year old!) but as I've been playing with this today, I thought it would be worth trying to clear up this question...

The answer is from here http://blogs.msdn.com/b/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx

As described on that page you need to create 3 classes - FlatWsdl, FlatWsdlServiceHost and FlatWsdlServiceHostFactory. Then for hosting in IIS, add a reference to the Factory class into the .svc markup file...

<%@ ServiceHost Language="C#"
  Factory="{YourNamespace}.FlatWsdlServiceHostFactory"
  Service="{YourNamespace}.WcfService1"%>

Also, it looks like this will be solved in WCF 4.5 :)
http://blogs.msdn.com/b/piyushjo/archive/2011/10/05/what-s-new-in-wcf-4-5-flat-wsdl-support.aspx

方圜几里 2024-11-24 01:55:43

ServiceHostFactory 就是答案,如下所述: http://msdn.microsoft.com/en -us/library/aa702697.aspx

ServiceHostFactory is the answer, described here: http://msdn.microsoft.com/en-us/library/aa702697.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文