cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Yu <jeff...@iona.com>
Subject Re: How to export non-annotated service in spring
Date Wed, 21 Nov 2007 09:35:48 GMT
You will have 2 filters, one for spring mvc, the other for the 
webservices that you want to expose: like :

  <servlet>
     <servlet-name>ims</servlet-name>
    
 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
  </servlet>
 
  <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <display-name>CXF Servlet</display-name>
        <servlet-class>
            org.apache.cxf.transport.servlet.CXFServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
  </servlet>

   <servlet-mapping>
     <servlet-name>ims</servlet-name>
     <url-pattern>*.do</url-pattern>
   </servlet-mapping>

    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

Question 2:
Using  serviceClass attribute like:

  <simple:server id="pojoservice" 
serviceClass="demo.hw.server.HelloWorld" address="/hello_world">
      <simple:serviceBean>
          <ref bean="#yourProxyObjectID" />
      </simple:serviceBean>
  </simple:server>

Thanks
Jeff


ojs wrote:
> Willem2 wrote:
>   
>> You should use CXFServlet to handler the http request and not the spring
>> DispatcherServlet.
>> Since CXFServlet will replace all the http related transport to the
>> servlet transport, you endpoint will not try to start a jetty engine for
>> http transport listening.
>>
>> You can find the CXFServlet's web.xml here.
>> [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/web-spring.xml
>> [2]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/spring.xml
>>
>>     
>
> Hello Willem,
>
> thanks for your help so far. It's a bummer, that CXF isn't as easy to
> configure as XFire is. I don't want to have another servlet, because I want
> to use the Spring MVC infrastructure (interceptors, custom mapping
> strategies, ...). I guess I can use Springs ServletWrappingController to
> wrap the CXFServlet - but this isn't a very good alternative compared to the
> XFireExporter.
>
> Another thing is: how to specify the Service interface? CXF currently tries
> to create an endpoint for my implementation (which is proxied). XFire has a
> serviceInterface property for that.
>
>
> Best
>
> Oliver
>
>   

Mime
View raw message