1

如http://static.springframework.org/spring-ws/sites/1.5/reference/html/security.html所述,我已经通过 WS-Security 在我的 web 服务上实现了身份验证,如下所示:

<bean id="callbackHandler" class="org.springframework.ws.soap.security.wss4j.callback.SimplePasswordValidationCallbackHandler">
    <property name="users">
        <props>
            <prop key="bart">arnie</prop>
        </props>
    </property>
</bean>

<bean id="annotationMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
    <property name="interceptors">
        <list>
            <bean class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
                <property name="validationActions" value="UsernameToken" />
                <property name="securementActions" value="NoSecurity" />
                <property name="validationCallbackHandler" ref="callbackHandler" />
            </bean> ...

但是,客户端(如 SoapUI)不知道他们应该使用安全性,因为 WSDL 中没有提到它。我怎样才能做到这一点?这就是我生成它的方式:

<bean id="qwertyService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
    <property name="schemaCollection" ref="schemaCollection" />
    <property name="portTypeName" value="QwertyService" />
    <property name="locationUri" value="/QwertyService/" />
    <property name="targetNamespace" value="http://www.ead2.nl/demo/wsdl" />
</bean>
4

2 回答 2

1

完全可以在 wsdl 中传递 ws-security 信息!!!!!!

查看 ws-policy ,特别是 ws-securitypolicy (两者一起使用)

但是,我无法具体帮助您实施。

希望这可以帮助

于 2009-08-23T10:04:32.677 回答
1

WS-Security 本身并不放在 WSDL 中。WS-Policy 建立在 WS-Security 之上,可以使用这些更复杂的标准将其添加到 WSDL 中,但听起来不像您想要的那样。

在 SOAPUI 中,安全信息被构建为项目的设置。如果您双击该项目,则会有一个安全选项卡。如果您使用基于 PKI 的方案,则可以添加密钥存储,并且您可以定义传出和传入配置。根据您想要保护的消息中的内容,可以将一对配置应用于每条消息。

见: http: //www.soapui.org/userguide/projects/wss.html

于 2009-08-28T15:34:18.627 回答