1

Mule Server 3.3.0 CE を使用して、次のコードを生成します。

 <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 サービスを作成することはできません。すべてのソリューションはこのページにリンクしていますが、SoapUI を真の値に変更する方法がわかりません。構成で何を変更する必要がありますか?

4

2 に答える 2

3

これを投稿すると、誰かが役立つかもしれません。HTTP コネクタを Mule の下位バージョンから 3.6+ または 3.7 に移行した人 (アップグレード時にこのエラーに直面したため)。リンク https://docs.mulesoft.com/mule-user-guide/v/3.6/configuring-the-spring-security-managermule-realmに従ってください (バージョン 3.3 のように HTTP リスナー内で構成することはできません)。SOAP UI からヒットしようとすると、上記のエラーが表示されますRegistered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session。Mule 設定ファイルの問題ではありません。SOAPUI の設定を変更する必要があります。

このエラーを解決する 2 つの方法:

SOAPUI->File->Preference->HTTP settings-> オプションを有効にするAuthenticate Preemptively

、SOAPUI
Authorization->Basic -> Pre-emptive auth -> enableで基本認証を設定する場合Authenticate Pre-emptively。デフォルトでは、「グローバル設定を使用」になりますが、これを次のように変更する必要がありますAuthenticate Pre-emptively

ありがとう。

于 2016-05-09T04:47:37.840 に答える
0

関連しているようで、発生しているエラーは赤いニシンです。これがログに記録されている場合でも、成功の応答が返されますか? http://www.mulesoft.org/jira/browse/MULE-5607

于 2013-03-27T13:11:31.820 に答える