2009-06-25 43 views
1

我實現了通過WS-Security的認證上我的web服務,像這樣:春天的WS-Security可見於<a href="http://static.springframework.org/spring-ws/sites/1.5/reference/html/security.html" rel="nofollow noreferrer">http://static.springframework.org/spring-ws/sites/1.5/reference/html/security.html</a>描述WSDL

<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> 
+0

顯然我誤解了WS-Security和它不可能在WSDL中註明。儘管如此,請隨時反駁。 – 2009-06-25 12:17:57

回答

1

WS-Security本身並不放在WSDL中。 WS-Policy基於WS-Security構建,有可能使用這些更復雜的標準將其添加到WSDL中,但聽起來並不像您想要的那樣。

在SOAPUI中,安全信息作爲項目的設置構建。如果您雙擊該項目,則會有一個安全選項卡。如果您使用的是基於PKI的方案並且您可以定義傳出和傳入配置,則可以添加密鑰存儲。根據您希望保護的消息內容,可以將一對配置應用於每條消息。

參見: http://www.soapui.org/userguide/projects/wss.html

+0

這確實是我所做的。爲了他人的緣故接受你的答案 – 2009-09-03 00:33:01

1

這是完全有可能傳達的WS-Security信息在WSDL !!!!!

看WS-Policy和具體WS-安全(兩人一起去)

然而,我無法比較特別幫你實現。

希望這有助於

相關問題