除其他功能外,它还允许将代码 xml 注释实时导出到生成的 WSDL 中,例如检查这些 xml 注释的情况:
/// <summary>
/// Retrieve the tickets information for the specified order
/// </summary>
/// <param name="orderId">Order ID</param>
/// <returns>Tickets data</returns>
[OperationContract]
TicketsDto GetTickets(int orderId);
反映在该接口的 WSDL 中:
<wsdl:operation name="GetTickets">
<wsdl:documentation>
<summary> Retrieve the tickets information for the specified order </summary> <param name="orderId">Order ID</param> <returns>Tickets data</returns>
</wsdl:documentation>
<wsdl:input wsaw:Action="xxxx" message="tns:PartnerAPI_GetTickets_InputMessage"/>
<wsdl:output wsaw:Action="xxxx" message="tns:PartnerAPI_GetTickets_OutputMessage"/>
</wsdl:operation>
他们的文档摘录:
从源代码 XML 注释添加 WSDL 文档
此扩展允许您直接从源文件中的 XML 注释添加 WSDL 文档(注释)。这些注释将作为 WSDL 的一部分发布,并且可供知道如何利用它们的 WSDL 工具使用(例如 Apache Axis wsdl2java 等)。 2.0 版还包括一个客户端 WSDL 导入器,它将在生成的代理代码中将这些 WSDL 注释转换为 XML 注释。