.net passport身份验证
集成windows身份验证
用帐号密码作为参数验证
利用ip验证

解决方案 »

  1.   

    能说详细点么?一个service的class在client的机器上就是一个代理class
    如何在他调用函数的时候验证呢?
      

  2.   

    假设你有一个类,叫做class1,里面有一个方法,叫做meth1(string arg1).
    你可以可以这样设计一下:
    给meth1增加一个参数meth1(string arg1,string sn)
    在你原来的方法内部,在进行处理以前,检验一下sn是否复合要求的。sn具体是什么,你写代码的人才知道。如果sn不正确的话,你直接return算了。
      

  3.   

    在MSDN帮助索引中打身份验证——xmlwebservice,你能找到答案。
      

  4.   

    设置SoapHeader,让用户调用Service的时候需要传递Header信息。
    class Security : System.Web.Service.Protocol.SoapHeader
    {
        public string userId;
        public string passHash;
    }然后在你的Web Method里添加如下属性
    public Security security;
    [WebMethod]
    [SoapHeader("security", Direction=SoapHeaderDirection.In,Required=true)]public string MyWebMethod() 
    {
         if(IsYourSystemUser(security.UserId, security.PassHash) return "Hello";
    }
      

  5.   

    to : 
    superct(圣堂·天子) 奇怪的出错C:\Inetpub\wwwroot\myFolder\WebServiceTest\Service1.asmx.cs(51): The type or namespace name 'security' could not be found (are you missing a using directive or an assembly reference?)