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; }
}
}
}
查看全文
相关阅读:
检测Linux硬盘IO数据
获取OrangePI板子CPU温度
ASP.Net开发WebAPI跨域访问(CORS)的精简流程
一些常用复合命令
关于Linux的虚拟内存管理
Linux中组 与 用户的管理
linux加载与使用ko驱动
7z命令行 极限压缩指令
nodejs的POST请求
案例:用ajax 方法 解析xml
原文地址:https://www.cnblogs.com/godwar/p/1128126.html
最新文章
嵌入式中 ARM的几种工作模式 以及异常模式的优先级
ARM 内核SP,LR,PC寄存器
内核request_mem_region 和 ioremap的理解
request_irq() | 注册中断服务
内核中的中断处理模型
linux中的阻塞机制及等待队列
access_ok | 检查用户空间内存块是否可用
BAT 批处理脚本教程
获取微博用户最新发博日期
Python处理图片缩略图
热门文章
python 特殊方法实例
django restful 1-在线Python编辑器
jsonp处理
天猫淘宝评论数据抓取
微博图文私信群发
splinter web测试框架
tornado 采用 epoll 代理构建高并发网络模型
tornado options
dotnet core 2.0在ubuntu下安装失败
电脑没有密码导致的共享目录别人无法访问
Copyright © 2011-2022 走看看