客户端:protected void Button2_Click(object sender, EventArgs e){ string str = ""; stuInfo1.StuName = "test"; str = ser.HelloStu(stuInfo1);//传递webservice中的实体类} WebServices端: [XmlInclude(typeof(Student))] [WebMethod] public void HelloStu(Student stuInfo) { stuInfo.StuName = "改变了!"; return stuInfo.StuName; }--------------------------------------------------------- 请问,如何做到客户端的stuInfo1的StuName值被改变?
2 回答
阿波罗的战车
TA贡献1862条经验 获得超6个赞
一、直接返回,WebServices端:
[XmlInclude(typeof(Student))]
[WebMethod]
public HelloStu(Student stuInfo)
{
stuInfo.StuName = "改变了!";
return stuInfo.StuName;
}二、先客户端
protected void Button2_Click(object sender, EventArgs e)
{
string str = "";
stuInfo1.StuName = "test";
ser.HelloStu( stuInfo1);//传递webservice中的实体类
}
再服务器端- 2 回答
- 0 关注
- 525 浏览
添加回答
举报
0/150
提交
取消
