Exactly what Ian stated.
The one caveat though is that there are a bunch of things that may need to be
imported into the contextConfigLocation depending on what is needed:
META-INF/cxf/cxf.xml
META-INF/cxf/cxf-extension-addr.xml
META-INF/cxf/cxf-extension-corba.xml
META-INF/cxf/cxf-extension-http-binding.xml
META-INF/cxf/cxf-extension-http-jetty.xml
META-INF/cxf/cxf-extension-http.xml
META-INF/cxf/cxf-extension-javascript-client.xml
META-INF/cxf/cxf-extension-jaxrs-binding.xml
META-INF/cxf/cxf-extension-jaxws.xml
META-INF/cxf/cxf-extension-jms.xml
META-INF/cxf/cxf-extension-local.xml
META-INF/cxf/cxf-extension-management.xml
META-INF/cxf/cxf-extension-object-binding.xml
META-INF/cxf/cxf-extension-policy.xml
META-INF/cxf/cxf-extension-rm.xml
META-INF/cxf/cxf-extension-soap.xml
META-INF/cxf/cxf-extension-ws-security.xml
META-INF/cxf/cxf-extension-xml.xml
(We really should document all of them and when/why you would need each one)
The GOOD news is we have a:
META-INF/cxf/cxf-all.xml
that automatically grabs all of the above. Thus, you COULD do:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:META-INF/cxf/cxf-all.xml
classpath:META-INF/cxf/cxf-servlet.xml
WEB-INF/ws-beans.xml
</param-value>
</context-param>
and pretty much get the entire thing setup just like if you did a pure
cxf-servlet.xml approach. That said, cxf-all does bring in a lot of stuff
you may not need (just like cxf-servlet approach) so startup is slower,
memory footprint is higher, etc....
Dan
On Sunday 21 September 2008 6:28:53 pm Ian Roberts wrote:
> Glen Mazza wrote:
> > 1.) If you use the default filename cxf-servlet.xml, you do *not* need
> > to explicitly list the <import resource="..."/> as you do in the
> > ws-beans.xml file as shown in [1]. With cxf-servlet.xml, *all* of the
> > imports are automatically brought in, and with an explicitly specified
> > ws-beans.xml file, *none* of the imports are brought in unless you
> > explicitly specify them--is that correct?
>
> As I understand it, the two choices when using CXF are (a) use the
> Spring ContextLoaderListener to set up the application context or (b)
> don't use the CLL, and instead let the CXF servlet load its own context
> including beans defined in cxf-servlet.xml. In case (a) Spring needs to
> be told where to find the bean definitions that make up the CXF
> infrastructure (the bus, etc.), but in case (b) the context created by
> the CXF servlet has these definitions imported automatically.
>
> The important thing is that the CXF infrastructure bean definitions have
> to get into the context somehow - in case (a) this is typically done
> using <import> but alternatively you could remove the imports from your
> ws-beans.xml and add the corresponding resource URLs to the
> contextConfigLocation parameter in web.xml, the results should be
> identical.
>
> <context-param>
> <param-name>contextConfigLocation</param-name>
> <param-value>
> classpath:META-INF/cxf/cxf.xml
> classpath:META-INF/cxf/cxf-extension-soap.xml
> classpath:META-INF/cxf/cxf-servlet.xml
> WEB-INF/ws-beans.xml
> </param-value>
> </context-param>
>
> Ian
--
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog