【问题标题】:Spring WS-Security visible in WSDLWSDL 中可见的 Spring WS-Security
【发布时间】:2009-06-25 11:00:15
【问题描述】:

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>

【问题讨论】:

  • 显然我误解了 WS-security 并且不可能在 WSDL 中指定这一点。不过,您可以随意反驳。

标签: wsdl ws-security spring-ws


【解决方案1】:

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

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

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

【讨论】:

  • 这确实是我所做的。为了别人的缘故接受了你的回答
【解决方案2】:

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

查看 ws-policy,特别是 ws-securitypolicy(两者结合在一起)

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

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-07
    相关资源
    最近更新 更多