Hi CXF Team,

At first I would like congratulate you because I'm very impressive with CXF
: powerfull and very simple!. Indeed I have tried to use Axis2 with JAX-WS
and I have take a very long time to have success with WebServices and there
is a lot of bug with JAXWSDeployer -(

With CXF my whole tests are sucessfull.

I write you because I'm using CXF without Spring, so I do like this in my
WEB Application  :

--------------------
Object implementor = new MyService();
String address = "myservice";
Endpoint.publish(address, implementor);
--------------------

It works great, but I'm lazy developer and I think it should be cool if we
have a JAXWSDeployer like Axis2 which is enable to scan classes from JAR and
WEB-INF/classes and deploy classes as WebService, if scanned class has the
@WebService or @WebServiceProvider.
I have not found this feature in the CXF documentation and I tell me if you
will be interested with this feature that I could develop and contribute to
CXF project.

My idea is to declare a Servlet in the web.xml like this :

--------------------
<servlet>
        <description>Apache CXF JAX-WS Deployer</description>
        <servlet-name>jaxwsdeployer</servlet-name>
        <servlet-class>org.apache.cxf.jaxws.JAXWSDeployer</servlet-class>
        <load-on-startup>2</load-on-startup>
</servlet>
--------------------

which is loaded after the CXFNonSpringServlet. This servlet works with a
jaxws-deployers.xml which could looks like this :

--------------------
<jaxws-deployers>
   <jaxws-deployer source="/WEB-INF/classes" packages="sample.ws.*"/>
   <jaxws-deployer source="/WEB-INF/lib/myservices.jar"
packages="sample2.ws.*"/>
</jaxws-deployers>
--------------------

This configuration will scan :

1) classes from packages sample.ws.* of the WEB-INF/classes folder, load
class and search if it find @WebService or @WebServiceProvider. In this
case, the following code could be executed :

--------------------
Object implementor = new MyService();
String address = "myservice";
Endpoint.publish(address, implementor);
--------------------

2) classes from the sample2.ws.* packages of the /WEB-INF/lib/myservices.jar
JAR.

This descriptor could be improved too to manage variable path like :

<jaxws-deployer source="$work/classes" packages="sample.ws.*"/>

where $temp is the custom value.

ClassLoader provider could be setted in the configuration.
<jaxws-deployer source="$work/classes" packages="sample.ws.*"
class-loader-provider="MyClassLoaderProvider"/>

I don't know if I have good explained my idea, but my question is are you
interested with this feature?

Perhaps JAXWSDeployer -like already exists but I have not found
documentation about that.
If you are interested, don't hesitate to tell me.

Thank a lot for your answer.

Regards Angelo

Reply via email to