WCF FlatWSDL - 如果您的主机是 IIS,您将必要的代码放在哪里?
基本上,在研究获取 FlatWSDL 的解决方案时,我发现了以下内容:
- http://weblogs.thinktecture.com/cweyer/2007/05/improving-wcf-interoperability-flattening-your-wsdl.html
- http://wcfextras.codeplex.com/
WCF Extras 看起来很有趣,但对于我的需要来说可能太多了(只是一个 FlatWSDL)。因此,第一个链接指出了如何做到这一点,但这就是问题所在。如果您将服务托管在 IIS 中,那么此代码将放在哪里?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这是一个老问题(一年多了!),但由于我今天一直在玩这个问题,我认为值得尝试澄清这个问题......
答案来自这里 http://blogs.msdn.com/b/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx
如该页面所述,您需要创建 3 个类 - FlatWsdl、FlatWsdlServiceHost 和FlatWsdlServiceHostFactory。然后,为了在 IIS 中托管,请将 Factory 类的引用添加到 .svc 标记文件中...
另外,看起来这将在 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...
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
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