C# 如何在技术规范中记录 WCF Web 服务?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/188919/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to document a WCF web-service in a technical spec?
提问by Loscas
Other than pasting a WDSL in the tech spec, what are the recommended ways to document a WCF web-service before you begin coding?
除了在技术规范中粘贴 WDSL 之外,在开始编码之前记录 WCF Web 服务的推荐方法是什么?
采纳答案by Thomas Bratt
We recently published a WCF based SOAP interface for third parties to integrate against. For each method we provided the following:
我们最近发布了一个基于 WCF 的 SOAP 接口,供第三方集成。对于每种方法,我们提供了以下内容:
- Method name
- Request example (wire format dump)
- Request parameters explanation
- Response example (wire format dump)
- Request parameters explanation
- Caveats (gotchas)
- History
- 方法名称
- 请求示例(有线格式转储)
- 请求参数说明
- 响应示例(有线格式转储)
- 请求参数说明
- 注意事项(陷阱)
- 历史
We also provide the WSDL. You may want to use Microsoft's Disco.exefor doing this. See also a related question about obtaining the WSDL.
我们还提供 WSDL。您可能希望使用 Microsoft 的Disco.exe来执行此操作。另请参阅有关获取 WSDL的相关问题。
回答by Dave Dunkin
Document the contract interface as you would document any other interface. Describe the operations, pre-conditions, post-conditions, reasons for throwing a fault, etc.
像记录任何其他接口一样记录合同接口。描述操作、前置条件、后置条件、引发故障的原因等。
回答by sebagomez
Also, in case you're using MessageContracts document why you are using them... trust me, you'll wonder why you did it :)
另外,如果您使用 MessageContracts 文档说明为什么要使用它们...相信我,您会想知道为什么要这样做:)
回答by Ray Lu
- Describe service endpoints and available protocols/binding. e.g. Https, RESTful?
- Security features, authentication, authorization and encryption.
- Explain the use cases of parameters in operation contract.
- Hosting, IIS, WindowsService or Console application.
- Instancing of the service.
- 描述服务端点和可用的协议/绑定。例如Https,RESTful?
- 安全功能、身份验证、授权和加密。
- 解释操作合约中参数的用例。
- 托管、IIS、WindowsService 或控制台应用程序。
- 服务的实例化。
回答by Panos
Microsoft documents some WCF services in MSDN. I think that you can get some ideas from the following links:
Microsoft 在 MSDN 中记录了一些 WCF 服务。我认为您可以从以下链接中获得一些想法: