博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WebService 的Description 属性说明(转)
阅读量:7059 次
发布时间:2019-06-28

本文共 926 字,大约阅读时间需要 3 分钟。

转自: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";
        }

转载于:https://www.cnblogs.com/wanganyi/p/7220210.html

你可能感兴趣的文章
我的友情链接
查看>>
.NET反编译的九大金刚
查看>>
开源项目:Android-Universal-Image-Loader总结
查看>>
CentOS6.5 ping: unknown host 解决方
查看>>
C语言拷贝文件夹(包含文件属性信息)
查看>>
keepalive配置
查看>>
使用Ansible部署LAMP环境
查看>>
mac下 连接windows远程桌面
查看>>
如何在LoadRunner中使用winsocket协议
查看>>
部署DNS服务器之主要区域
查看>>
Android防反编译
查看>>
数字医学影像工作站相关资料汇总
查看>>
20051008网络工程师必懂的专业术语
查看>>
2012年我的十大工程7——阅读工程
查看>>
windows调整网卡访问顺序
查看>>
我的php学习笔记(42) PHP通过mail()或Socket发从邮件
查看>>
Mysql-主从精简配置
查看>>
ROM 、RAM和FLASH 的区别
查看>>
深入挖掘vsftpd服务
查看>>
使用smtplib发送E-mail
查看>>