[英]Using WCF in .NET how can I make it auto generate SOAP docs like ASMX did?
I'm currently writing a web service using WCF in VB.NET. 我目前正在VB.NET中使用WCF编写Web服务。
Previous web services I wrote used ASMX but I wanted to learn WCF and so far it's going well. 我以前编写的Web服务使用的是ASMX,但我想学习WCF,到目前为止一切顺利。 I actually prefer the way WCF does things.
我实际上更喜欢WCF的处理方式。
One thing I miss however is the way that ASMX used to generate example SOAP requests and responses. 但是我想念的一件事是ASMX用来生成示例SOAP请求和响应的方式。 It was like getting documentation for free.
就像免费获取文档一样。
Is there anyway to auto generate SOAP documentation for WCF? 无论如何,有没有为WCF自动生成SOAP文档的方法?
If not, is there any way to generate it in a .NET page using the WSDL? 如果没有,是否有任何方法可以使用WSDL在.NET页面中生成它?
I guess this isn't supported by WCF in the same way it was for ASMX because WCF supports multiple endpoint types, not just SOAP web services (eg Net TCP, named pipes, etc). 我想WCF不像ASMX那样支持它,因为WCF支持多种终结点类型,而不仅仅是SOAP Web服务(例如,Net TCP,命名管道等)。
SoapUI is a good little tool that can auto-generate SOAP messages from WSDL. SoapUI是一个很好的小工具,可以从WSDL自动生成SOAP消息。 Or you could create a small test client app, enable WCF tracing, and use the Service Trace Viewer Tool to view the messages that were sent.
或者,您可以创建一个小型测试客户端应用程序,启用WCF跟踪,然后使用Service Trace Viewer工具查看已发送的消息。
I eventually found the answer. 我终于找到了答案。 WCFExtras .
WCFExtras 。 The WCFExtras library allows you to document your API using XML comments and it reads those comments and inserts them into the WSDL as documentation comments.
WCFExtras库允许您使用XML注释来记录API,并读取这些注释并将其作为文档注释插入到WSDL中。 We then read this and generate HTML documentation using an application called TechWriter.
然后,我们阅读并使用称为TechWriter的应用程序生成HTML文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.