[jboss-dev-forums] [JBoss AS 7 Development] - JBossWS/CXF configuration / extensions

Robert Stupp do-not-reply at jboss.com
Fri Dec 9 08:40:09 EST 2011


Robert Stupp [http://community.jboss.org/people/snazy0] created the discussion

"JBossWS/CXF configuration / extensions"

To view the discussion, visit: http://community.jboss.org/message/640779#640779

--------------------------------------------------------------
Hi,

I am currently working on a project, where we need to add custom CXF interceptors to the CXF bus for the current deployment.

The only practically working way to customize the deployment is to add a WEB-INF/jbossws-cxf.xml file to our deployment.
Generally it works, but there are some bad things using the combination AS7/JBossWS/CXF.

We have a lot of web services which are bundled in one or more WAR files.
All of them have "standard" JAX-WS annotations (e.g. @WebService) and work fine (everything bundled in a WAR in an EAR ; deploy to AS7 ; fine).

But as I mentioned, we need custom interceptors.

So I added the interceptors to a jbossws-cxf.xml file:
    <jaxws:endpoint
            address=' http://@jboss.bind.address@/demo/service/SuperService http://@jboss.bind.address@/demo/service/SuperService'
            implementor='com.mycompany.demo.java.MySuperWebservice'>
        <jaxws:inInterceptors>
            <ref bean="myGreatInterceptor"/>
        <jaxws:inInterceptors>
    </jaxws:endpoint>

This works - but what I really want is a default bus configuration for all webservices in the WAR file (deployment) - I do not want to configure all web services. So I tried the following approach in jbossws-cxf.xml:
    <bean class="com.mycompany.jboss7.cxf.BusInterceptorsInjector" init-method="injectInterceptors">
        <property name="bus" ref="cxf"/>
        <property name="inInterceptors">
            <list>
                <ref bean="FrameworkCxfPreInvokeInterceptor"/>
                <ref bean="FrameworkCxfPostInvokeInterceptor"/>
            </list>
        </property>
    </bean>
This works - but only if *every* webservice is mentioned like
    <jaxws:endpoint
            address=' http://@jboss.bind.address@/demo/service/SuperService http://@jboss.bind.address@/demo/service/SuperService'
            implementor='com.mycompany.demo.java.MySuperWebservice'/>
This is silly, because the jaxws:endpoint configuration specifies nothing meaningful.
Every invocation of a web service which is not mentioned in a jbossws-cxf.xml file, fails with a NullPointerException in org.jboss.wsf.stack.cxf.CXFInstanceProvider at line 57 - the CXFInstanceProvider is configured with a "null" ServerFactoryBean.

What I would like to have in AS7/JBossWS/CXF is
* a mechanism, where I can configure the CXF bus for each deployment (specifying another bus definition in jbossws-cxf.xml does not work, because the "default" bus is created "inside the server code") and
* no need to specify every web service in jbossws-cxf.xml and
* no need to specify the fully qualified address attribute in jaxws:endpoint - developers do not know the exact address, port and context path ot a deployment. AS7/JBossWS should accept at least paths relative to the context root of the current deployment (specifying addresses like /service/SuperService does not work - it cannot find the destination of a web service call)
* no need to specify the implementor in jaxws:endpoint, because it is already configured elsewhere (web.xml) - a functionaltity like a "servlet-link" would be great

Robert.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/640779#640779]

Start a new discussion in JBoss AS 7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20111209/870c9a65/attachment.html 


More information about the jboss-dev-forums mailing list