的.asmx Web服务文档 [英] .asmx Web Service Documentation

查看:251
本文介绍了的.asmx Web服务文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的总结,参数信息,返回信息等(见下表)显示出来的。NET生成的.asmx Web服务的标准帮助页面。

I'd like my summary, param info, returns info, etc (listed below) to show up on the standard help page that .net generates for .asmx web services.

/// <summary>
/// Brief description
/// </summary>
/// <param name="fakeParamOne">Fake Param One Description</param>
/// <returns>Bool representing foo</returns>

这是我试过了影响自动生成的帮助页面以任何方式是这样做的唯一的事情:

The only thing that I've tried that affected the auto-generated help page in any way was this:

[WebMethod(Description = "Does awesome things.")]

我敢肯定,我失去了一些东西很简单(或者它不能做我想做的)。有什么建议?

I'm sure I'm missing something VERY simple (or it's not possible to do what I want). Any suggestions?

推荐答案

像@约翰·桑德斯则留言中提到有没有真正使用XML方法注释在WSDL帮助展现了一个自动的方式,但也有几个选择让你在找什么。

Like @John Saunders comment mentioned there's not really an automatic way to use the XML method comments to show up in the WSDL Help, but there are a couple of alternatives to get what you're looking for.

的WebMethod Description属性可以设置为格式化HTML

下面是一个例子:

const string someWebMethodDescription = @"
<table>
    <tr>
        <td>Summary:</td><td>[My Summary]</td>
    </tr>
    <tr>
        <td>Parameters:</td><td>&nbsp;</td>
    </tr>
    <tr>
        <td>fakeParam:</td><td>[My Fake Param Description]</td>
    </tr>
</table>";

[WebMethod(Description=someWebMethodDescription)]
public List<string> SomeWebMethod

在哪里,结果是:

Where the result is:

此外,要创建一个自定义WSDL帮助页

<configuration>
   <system.web>
      <webServices>
         <wsdlHelpGenerator href="docs/HelpPage.aspx"/>
      </webServices>
   </system.web>
</configuration>

检查细节此$ C $的CProject职位上制作自己HelpPage:

check this codeproject post for details on making your own HelpPage:

改善ASP.NET web服务帮助发生器,以反映传承 - $ C $的CProject

这篇关于的.asmx Web服务文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆