<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:spring="http://www.springframework.org/schema/beans"
       xmlns:acegi="http://www.mulesource.org/schema/mule/acegi/2.0"
       xmlns:axis="http://www.mulesource.org/schema/mule/axis/2.0"
       xmlns:servlet="http://www.mulesource.org/schema/mule/servlet/2.0"
    xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
       http://www.mulesource.org/schema/mule/acegi/2.0 http://www.mulesource.org/schema/mule/acegi/2.0/mule-acegi.xsd
       http://www.mulesource.org/schema/mule/axis/2.0 http://www.mulesource.org/schema/mule/axis/2.0/mule-axis.xsd
       http://www.mulesource.org/schema/mule/servlet/2.0 http://www.mulesource.org/schema/mule/servlet/2.0/mule-servlet.xsd">

    <spring:bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
        <spring:property name="userDetailsService" ref="inMemoryDaoImpl"/>
    </spring:bean>

    <spring:bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
        <spring:property name="userMap" value="ross=ross_may_not_invoke_web_service,ROLE_ADMIN"/>
    </spring:bean>

    <byte-array-to-string-transformer name="ByteArrayToString"/>

    <servlet:connector name="servletConnector" servletUrl="http://localhost:18088/services">
        <!--  TODO DO: this should not be necessary, see MULE-1508 -->
        <custom-exception-strategy class="org.mule.transport.soap.axis.UnitTestExceptionStrategy"/>
    </servlet:connector>

    <acegi:security-manager>
        <acegi:delegate-security-provider name="memory-dao" delegate-ref="daoAuthenticationProvider"/>
    </acegi:security-manager>

    <model name="test">
        <service name="mycomponent">
            <inbound>
                <axis:inbound-endpoint address="servlet://mycomponent"
                                       responseTransformer-refs="ByteArrayToString">
                    <acegi:http-security-filter realm="mule-realm"/>
                </axis:inbound-endpoint>
            </inbound>
            <component class="org.mule.component.simple.EchoComponent"/>
        </service>
    </model>

</mule>
