[ 
https://issues.apache.org/activemq/browse/SM-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56461#action_56461
 ] 

brad commented on SM-1897:
--------------------------

I have also encountered this problem and found an acceptable solution to it.

A little more information about the problem first.

1. The WSDL in use has a target namespace specified as 
targetNamespace="urn:/test.wsdl"
2. The security.xml wants to protect this resource, with a setting such as 
<sm:authorizationEntry service="urn:/test.wsdl:testService" roles="mygroup" />

This particular QName string specified in the "service" parameter gets messed 
up in QNameHelper.createQName() method, and I couldn't see a way to define 
something compatible, given the way it looks for the first instance of a colon 
to become the prefix, and goes from there.

So, the solution I've come up with is constructing my own QName object in 
Spring, therefore avoiding the QNameHelper process completely.

Before:

    <sm:authorizationEntry service="urn:/test.wsdl:testService" roles="mygroup" 
/>

After:

    <sm:authorizationEntry>
        <property name="service" ref="blerg" />
        <property name="roles" value="mygroup" />
    </sm:authorizationEntry>

    <bean name="blerg" class="javax.xml.namespace.QName">
        <constructor-arg>
            <value>urn:/test.wsdl</value>
        </constructor-arg>
        <constructor-arg>
            <value>testService</value>
        </constructor-arg>
    </bean>

A more verbose definition, but it got the job done...

> authorizationEntry service namespace can't be a urn
> ---------------------------------------------------
>
>                 Key: SM-1897
>                 URL: https://issues.apache.org/activemq/browse/SM-1897
>             Project: ServiceMix
>          Issue Type: Bug
>    Affects Versions: 3.3.1
>         Environment: Windows XP Pro.
> Java 1.6.0_12
>            Reporter: Trudi Ersvaer
>         Attachments: groups.properties, security.xml, SM-1897-sa.zip, 
> users-passwords.properties
>
>
> In security.xml the authorizationEntry's service attribute seems not to cope 
> with a urn namespace.
> For example, I've replaced the existing authorization entry (in security.xml) 
> with a new one:
> service="{urn:/addsource.wsdl}:addsourceService" roles="superuser"
> The problem with this is that I get a PatternSyntaxException because the 
> service name is translated into (I can see this in the debugger):
> {{urn}/addsource.wsdl}:addsourceService  
> When I removed the braces from the service name in security.xml for example: 
> service="urn:/addsource.wsdl:addsourceService" roles="superuser"
> the service still doesn't match because the service name is transated into 
> (again viewed in the debugger): 
> {urn}/addsource.wsdl:addsourceService
> If I change all my namespaces to:
> xxx
> and in security.xml changed the service name to:
> xxx:addsourceService
> finally the service matched and authZ works.
>  
> Any ideas why the authorizationEntry isn't coping with a urn namespace?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to