zoukankan
html css js c++ java
IList Webservice 序列化
using
System;
using
System.Collections;
using
System.Web;
using
System.Web.Services;
using
System.Web.Services.Protocols;
using
System.Xml.Serialization;
[WebService(Namespace
=
"
http://tempuri.org/
"
)]
[WebServiceBinding(ConformsTo
=
WsiProfiles.BasicProfile1_1)]
public
class
Service : System.Web.Services.WebService
...
{
public
Service ()
...
{
//
Uncomment the following line if using designed components
//
InitializeComponent();
}
[WebMethod]
public
string
HelloWorld()
...
{
return
"
Hello World
"
;
}
[WebMethod]
[XmlInclude(
typeof
(Article))]
public
IList GetArticleList()
...
{
IList result
=
new
ArrayList();
for
(
int
i
=
0
; i
<
20
; i
++
)
...
{
string
title
=
string
.Format(
"
新闻标题-{0}
"
, i);
string
content
=
string
.Format(
"
新闻内容-{0}
"
, i);
DateTime time
=
DateTime.Now.AddDays(i);
result.Add(
new
Article(title, content, time));
}
return
result;
}
public
class
Article
...
{
private
string
title;
private
string
content;
private
DateTime time;
public
Article()
...
{
}
public
Article(
string
title,
string
content,DateTime time)
...
{
this
.title
=
title;
this
.content
=
content;
this
.time
=
time;
}
public
string
Title
...
{
get
...
{
return
title; }
set
...
{ title
=
value; }
}
public
string
Content
...
{
get
...
{
return
content; }
set
...
{ content
=
value; }
}
public
DateTime Time
...
{
get
...
{
return
time; }
set
...
{ time
=
value; }
}
}
}
查看全文
相关阅读:
阿里数据中台底座的12年建设实践
淘宝小部件:全新的开放卡片技术!
判断QQ是否在线
Linux消息队列应用
轻松学习Linux之如何创建可执行脚本
JAVA多线程学习笔记
轻松学习Linux之Shell文件和目录属性详解
Firefox必备的24款web开发插件
数论+图论+map——cf1323E
【codevs1116】四色问题
原文地址:https://www.cnblogs.com/godwar/p/1128126.html
最新文章
P1259 黑白棋子题解
P3612 秘密奶牛码题解
论文解读丨Zero-Shot场景下的信息结构化提取
CWE发布2021年最危险的25种软件缺陷
AI开发者十问:10分钟了解AI开发的基本过程
教你如何将二进制文件导入到数据库
队列Queue:任务间的消息读写,安排起来~
云图说|ROMA演进史:一个ROMA与应用之间不得不说的故事
关于线程的执行顺序,可能真的只是你以为的你以为
面试官:说一下Jena推理
热门文章
又一数据库高危漏洞爆出,数据安全如何有效保障?
Java的这个强大功能,很多人都不知道
2021年阿里云年中钜惠攻略,注册即可抽 iPhone 12 Pro 等好礼
Flink on Zeppelin 流计算处理最佳实践
如何用阿里云实行全链路数据追踪
设计模式在业务系统中的应用
外部工具连接SaaS模式云数据仓库MaxCompute实战——商业BI分析工具篇
产品解读 | 敏捷版数据库场景 一站式快速构建企业全场景数据库管理平台
MySQL 8.0 Server层最新架构详解
Hologres揭秘:如何支持超高QPS在线服务(点查)场景
Copyright © 2011-2022 走看看