惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
S
Securelist
P
Proofpoint News Feed
D
DataBreaches.Net
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Project Zero
Project Zero
A
About on SuperTechFans
罗磊的独立博客
WordPress大学
WordPress大学
月光博客
月光博客
Latest news
Latest news
C
Cyber Attacks, Cyber Crime and Cyber Security
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
AI
AI
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Help Net Security
Help Net Security
T
Tor Project blog
V
Vulnerabilities – Threatpost
C
Cisco Blogs
I
Intezer
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MyScale Blog
MyScale Blog
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Forbes - Security
Forbes - Security
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
T
Threat Research - Cisco Blogs
B
Blog RSS Feed
博客园 - 叶小钗
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Simon Willison's Weblog
Simon Willison's Weblog
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic

博客园 - 城

使用WebClient进行上传文件 序列化成字符串 - 城 - 博客园 东北话 c# MD5加密 SubVersion的多库权限配置 Visual Studio .NET has detected Web server is not running ASP.NET 1.1(vs.2003) Unable to generate a temporary class (result=1).error CS2001: Source file '...... VS.net 2005快捷键一览表 Tsql123 Windows Service OnCustomCommand 的問題 vba控件常规使用 vba 中 加载DLL错误的解决方法 无法在Web服务器上启动调试。您不具备调试此应用程序的权限,此项目的URL位于Internet区域。 安装程序工具 (Installutil.exe) 文件上传 XML简单操作 WSE2.0加密Web Service windows2003reg 在1433 以外的任何端口上连接到SQL Server
soap验证
· 2006-10-31 · via 博客园 - 城

No.1 先定义一个SoapHeader
/// <summary>
/// 定义SoapHeader.
/// </summary>
public class CredentialSoapHeader : SoapHeader
{
    public string Username;
    public string PasswordHash;
    public string SecurityKey;
}
-------------------------------------------------------
No.2 定义安全类,继承WebService。并提供验证方法。
public class SecureWebService : WebService
{
    public CredentialSoapHeader Credentials;
    protected string VerifyCredentials()
    {
        if (this.Credentials == null
        || this.Credentials.Username == null
        || this.Credentials.PasswordHash == null)
        {
            throw new SoapException("没有提供信任令牌",
                SoapException.ClientFaultCode, "Security");
        }
        return CheckCredential(this.Credentials);
    }
}
----------------------------------------------------------------------
No.3 让你发布的webservice继承你的安全类。
public class SecureService : SecureWebService
{

    public SecureService()
    {

        //如果使用设计的组件,请取消注释以下行
        //InitializeComponent();
    }
}
-----------------------------------------------------------
No.4发布你的Webservice。在客户端对SoapHeader赋值,调用Webservice。完成。