zoukankan      html  css  js  c++  java
  • 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";
            }

  • 相关阅读:
    [译]ABP vNext微服务演示,项目状态和路线图
    [译]初试C# 8.0
    [译]ABP vNext介绍
    ViewModel从未如此清爽
    python 函数基础及装饰器
    python 基础一
    scrapy基础二
    scrapy 基础
    python 基础技巧
    pandas 基础
  • 原文地址:https://www.cnblogs.com/wanganyi/p/7220210.html
Copyright © 2011-2022 走看看