2012-11-27 54 views
1

工作,我用騾服務器3.3.0 CE,我生成這樣的代碼:HTTP安全過濾器不騾子

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:http="http://www.mulesoft.org/schema/mule/http" 
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern" 
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security" 
xmlns:ss="http://www.springframework.org/schema/security" 
xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd 
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.3/mule-http.xsd 
    http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.3/mule-pattern.xsd 
    http://www.mulesoft.org/schema/mule/spring-security 
    http://www.mulesoft.org/schema/mule/spring-security/3.3/mule-spring-security.xsd 
    http://www.springframework.org/schema/security 
    http://www.springframework.org/schema/security/spring-security-3.1.xsd"> 

<mule-ss:security-manager> 
    <mule-ss:delegate-security-provider 
     name="memory-dao" delegate-ref="authenticationManager" /> 
</mule-ss:security-manager> 

<spring:beans> 
    <ss:authentication-manager alias="authenticationManager"> 
     <ss:authentication-provider> 
      <ss:user-service id="userService"> 
       <ss:user name="sepideh" password="16978413" authorities="ROLE_ADMIN" /> 
      </ss:user-service> 
     </ss:authentication-provider> 
    </ss:authentication-manager> 
</spring:beans> 


<pattern:web-service-proxy name="myService" 
    wsdlLocation="http://ws.acme.com:6090/wsdl/weather-forecast"> 
    <http:inbound-endpoint address="http://localhost:8090/service"> 
     <mule-ss:http-security-filter realm="mule-realm" /> 
    </http:inbound-endpoint> 
    <http:outbound-endpoint address="http://ws.acme.com:6090/weather-forecast" /> 
</pattern:web-service-proxy> 

我跑這個項目,我有以下異常:

ERROR 2012-11-27 14:31:25,456 [[web_service].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy: 
******************************************************************************** 
Message    : Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/service. Message payload is of type: String 
Code     : MULE_ERROR-54999 
-------------------------------------------------------------------------------- 
Exception stack is: 
1. Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/service. Message payload is of type: String (org.mule.api.security.UnauthorisedException) 
org.mule.transport.http.filters.HttpBasicAuthenticationFilter:160 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/security/UnauthorisedException.html) 
-------------------------------------------------------------------------------- 
Root Exception stack trace: 
org.mule.api.security.UnauthorisedException: Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/sevice. Message payload is of type: String 
    at org.mule.transport.http.filters.HttpBasicAuthenticationFilter.authenticateInbound(HttpBasicAuthenticationFilter.java:160) 
    at org.mule.security.AbstractEndpointSecurityFilter.authenticate(AbstractEndpointSecurityFilter.java:58) 
    at org.mule.security.AbstractAuthenticationFilter.doFilter(AbstractAuthenticationFilter.java:56) 
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) 

新的WSDL地址告訴我,但對於創建Web服務,我不能使用這個地址。 所有解決方案鏈接到this page,但我不知道如何將SoapUI更改爲真實值。 我應該在配置中更改哪些內容?

+0

您是否正在發送身份驗證標頭? – Seba

回答

2

發佈這可能有助於某人。將Mule較低版本的HTTP連接器遷移到3.6+或3.7(因爲我在升級時遇到此錯誤)的人。請按照鏈接https://docs.mulesoft.com/mule-user-guide/v/3.6/configuring-the-spring-security-manager(我們不能像在3.3版本中那樣在HTTP偵聽器中配置mule-realm)。當你嘗試從SOAP UI中找到它時,你會發現上面的錯誤Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session。這是不是騾子配置file.Need問題改變SOAPUI設置

2種方法來解決此錯誤:

轉到SOAPUI->文件 - >優先 - > HTTP設置 - >啓用該選項Authenticate Preemptively

當設置SOAPUI中的基本認證時
授權 - >基本 - >優先認證 - >啓用Authenticate Pre-emptively。 默認情況下,它將'使用全局首選項'需要更改爲Authenticate Pre-emptively

謝謝。