kris beaumont created CXF-4903:
----------------------------------

             Summary: jaxws:handlers is not treated as a list in 
ServerFactoryBeanDefinitionParser
                 Key: CXF-4903
                 URL: https://issues.apache.org/jira/browse/CXF-4903
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.7.2
            Reporter: kris beaumont


I find this in the code:

 @Override
    protected void mapElement(ParserContext ctx, BeanDefinitionBuilder bean, 
Element el, String name) {
        if ("properties".equals(name)) {
            Map<?, ?> map = ctx.getDelegate().parseMapElement(el, 
bean.getBeanDefinition());
            bean.addPropertyValue("properties", map);
        } else if ("executor".equals(name)) {
            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.executor");
        } else if ("invoker".equals(name)) {
            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.invoker");
        } else if ("binding".equals(name)) {
            setFirstChildAsProperty(el, ctx, bean, "bindingConfig");
        } else if ("inInterceptors".equals(name) || 
"inFaultInterceptors".equals(name)
            || "outInterceptors".equals(name) || 
"outFaultInterceptors".equals(name)
            || "features".equals(name) || "schemaLocations".equals(name)) {
            List<?> list = ctx.getDelegate().parseListElement(el, 
bean.getBeanDefinition());
            bean.addPropertyValue(name, list);
        } else {
            setFirstChildAsProperty(el, ctx, bean, name);            
        }        
    }
    

where I think the list treatment should also be done for the "handlers" 
property (that now uses the setFirstChildAsProperty default=> only one handler 
from the 'list' is added.

So for this definition:

  <!---->
    <jaxws:server id="webService" address="/lightWS" >
        <jaxws:handlers>
            <list>
                <!--FIRST get the login data from the ecas login ticket 
header-->
                <bean class="ServiceTicketServerSOAPHandler"  />
                <!--SECOND get the username and map it to an applicationCode to 
be stored in the threadlocal -->
                <bean class="ApplicationCodeSoapHandler" />
            </list>
        </jaxws:handlers>
        <jaxws:serviceBean>
            <ref bean="webServiceImpl" />
        </jaxws:serviceBean>
    </jaxws:server>

In the end I only have the first handler and not both, which should be easy to 
fix with:



 @Override
    protected void mapElement(ParserContext ctx, BeanDefinitionBuilder bean, 
Element el, String name) {
        if ("properties".equals(name)) {
            Map<?, ?> map = ctx.getDelegate().parseMapElement(el, 
bean.getBeanDefinition());
            bean.addPropertyValue("properties", map);
        } else if ("executor".equals(name)) {
            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.executor");
        } else if ("invoker".equals(name)) {
            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.invoker");
        } else if ("binding".equals(name)) {
            setFirstChildAsProperty(el, ctx, bean, "bindingConfig");
        } else if ("inInterceptors".equals(name) || 
"inFaultInterceptors".equals(name)
            || "outInterceptors".equals(name) || 
"outFaultInterceptors".equals(name)
            || "features".equals(name) || "schemaLocations".equals(name)
            || "handlers".equals(name) //also include the handlers
) {
            List<?> list = ctx.getDelegate().parseListElement(el, 
bean.getBeanDefinition());
            bean.addPropertyValue(name, list);
        } else {
            setFirstChildAsProperty(el, ctx, bean, name);            
        }        
    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to