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

-- 
Ian Roberts               | Department of Computer Science
[EMAIL PROTECTED]  | University of Sheffield, UK

Reply via email to