WebService 的Description 属性说明(转)
转自: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";
        }
 
                    
                     
                    
                 
                    
                 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号