一个WebService只能发布有一个对象类,我想问大家是不是缺陷,还是我不会用?一个实用的WebService肯定有很多对象要发布,总不能一个对象就要

liangpz_2000 2002-04-18 05:02:49
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Web;
using System.Configuration;
using System.Web.Services;

namespace WebService1
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class OASysUser : WebService
{
public OASysUser()
{
//CODEGEN:该调用是 ASP.NET Web 服务设计器所必需的
InitializeComponent();
}

private void InitializeComponent()
{
}

[WebMethod]
public string GetUsers(string name)
{
return name;
}
}
public class OAProject : WebService
{
public OAProject()
{
//CODEGEN:该调用是 ASP.NET Web 服务设计器所必需的
InitializeComponent();
}

private void InitializeComponent()
{
}

[WebMethod]
public string GetProject(string name)
{
return name;
}
}
}
...全文
72 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dcren 2002-04-28
  • 打赏
  • 举报
回复
当然支持任意多类了,好好看看联机帮助
lin_lin 2002-04-26
  • 打赏
  • 举报
回复
多用几个[WebMethod]就可以了
abedon 2002-04-21
  • 打赏
  • 举报
回复
不明白你的意思,大概是你不会用。

using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Web;
using System.Configuration;
using System.Web.Services;

namespace WebService1
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class OAUser : WebService
{
public OAUser()
{
//CODEGEN:该调用是 ASP.NET Web 服务设计器所必需的
InitializeComponent();
}

private void InitializeComponent()
{
}

[WebMethod]
public string GetUsers(string name)
{
return name;
}

[WebMethod]
public string GetProject(string name)
{
return name;
}
}

}

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧