【发布时间】: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