mic*_*use 3 soap web-services header
我有一个网络服务,我想从肥皂头对用户进行身份验证。也就是说,我想检查soap标头中的令牌id(随机数),并根据数据库中的值验证它,如果数字匹配,我允许请求通过,否则我不想允许执行我的Web方法。
有没有使用 SOAP 标头来完成此操作的干净方法?
谢谢,
姆纳尔·杰斯瓦尔
您研究过WS-Security吗?假设您还没有将其用于其他用途,您可以在 Username 元素等中携带您的令牌。
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-1">
<wsse:Username>yourusername</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">yourpassword</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<yourbodygoeshere>
</soapenv:Body>
</soapenv:Envelope>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
48944 次 |
| 最近记录: |