Glen,

(Typing this on a plane.   Not sure when I'll be connected to send this 
to you, but.....)

Much of this is a bit historical.  (jeeesh...   I'm giving a historical 
excuse on a project that has only had releases for 5 months.)    If you 
go back to the 2.0 release, things really didn't work very well if you 
DIDN'T use the cxf-servlet thing.   With the cxf-servlet stuff, a Bus is 
created first (from the cxf.xml) and then the servlet would replace the 
transport, and then refresh with the cxf-servlet to create the 
endpoints.    If you tried it without the two phase init stuff, the 
endpoints would either get a "wrong" bus or a partially initialized bus 
or similar.   Lots of stuff was just broken.

With 2.0.2 and 2.0.3, I went through a BUNCH of the spring initialization 
things to clean that up.   Thus, it should now work either way.   

Using the normal spring applicationContext thing and explicitely 
importing just the cxf modules that you need certainly is the lightest 
weight approach.   Doing that, you can get it pared down quite a bit (to 
just soap/http) which can help with startup time.   However, it's very 
easy to miss things that could cause functionality issues.   For 
example, in 2.0.3 we have added a META-INF/cxf/cxf-extension-jaxws.xml 
that defines the object used to inject the WebServiceContext into spring 
beans which helps get around some of the Spring AOP issues.    

The cxf-servlet way, because we initialize a the Bus with ALL the 
cxf-extension-* things, that makes sure ALL the features are available.   
It definitely is slower, but is may be more "reliable".   (And for what 
it's worth, we run the TCK using the cxf-servlet mode.)

I hope that helps explain the histor

Dan



On Thursday 15 November 2007, Glen Mazza wrote:
> Hello,
>
> I'm getting confused over the server-side configuration files for CXF.
> When deploying a web service in a WAR file, what is the difference
> between the cxf.xml config file and the cxf-servlet.xml config file? 
> I know the former needs to be on the classpath, and the latter is kept
> directly under the WEB-INF folder--but what is the difference in those
> two files' contents or purpose?
>
> Or, is there really no cxf.xml for the service, that cxf.xml is only
> to be packaged with the client?  I.e., can everything that is
> specified in the cxf.xml actually be specifiable in the cxf-servlet
> instead, eliminating the need for both files?
>
> Thanks,
> Glen



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to