首页 > Web开发 > 详细

WebService 的Description 属性说明(转)

时间:2017-07-22 09:29:51      阅读:381      评论:0      收藏:0      [点我收藏+]

转自:http://exception.thinksaas.cn/0/173/173623.html 

在WebMethod的description 中可使用超文本,

举例:

技术分享

如上图中,红框类的WebService的接口说明是如何实现的?
1、加粗字体的标题
2、换行
3、链接
4、图标

这是服务接口http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
------解决思路----------------------
    [WebService(Namespace = "http://tempuri.org/",Description="说明1")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {

        [WebMethod(Description="说明2")]
        public string HelloWorld()
        {
            return "Hello World";
        }
    }
------解决思路----------------------
Description里面可以放超文本

 [WebMethod(Description="<h1>This is a test method</h1><br /> It returns hello world </br> enjoy it. <br/><br/> <a href=‘http://www.microsoft.com‘>test link</a>")]
        public string HelloWorld()
        {
            return "Hello World";
        }

WebService 的Description 属性说明(转)

原文:http://www.cnblogs.com/wanganyi/p/7220210.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!