保障Web服务的安全
Web服务已从基于传送的安全转移到基于信息的安全,然而又是如何确保信号的安全,而不不传输的安全?答案在于OASIS标准,一个把三层安全策略加到SOAP信号中去的机制:WS-Security。
为了提供一个简单的在运转的WS-Security的用况,我用图一中所提供的认证的属性——用户名,密码认证标志——并使用getEmpSalary方法把他们应用到HRService Web服务
在我点击了安全向导上的OK之后,列表一中的Oracle-specific 描述符文件就产生了(用最小的命名空间表示)。注意到WS-Security运行时能力被元素使能。服务端对用户名和密码口令认证的需要被元素定义。
代码列表一:oracle-webservices.xml.中的WS-Security服务器配置
<oracle-webservices>
<webservice-description name="HRService">
<port-component name="HRServicePort">
<runtime enabled="security">
<security>
<inbound>
<verify-username-token password-type="Plain Text"
require-nonce="false"
require-created="false"/>
</inbound>
</security>
</runtime>
<operations>
<operation name="getEmpSalary"
input="{http://server.omag.com}getEmpSalaryElement"/>
</operations>
</port-component>
</webservice-description>
</oracle-webservices>
一旦这些配置被布置在一个一般的Web服务Ear文件。在Oracle应用程序服务器端运行时的管理配置文件wsmgmt .xml会被这个信息更新。我在上个月的Web服务管理专栏中用图表的方式解释了这个过程。在布置以后,这个Web服务也就可以用WS-Security的用户名密码标志来测试了。
- 本文关键词:

