如何使用注释仅使用Spring 3配置Jax-WS?

时间:2015-06-17 12:39:50

标签: spring web-services jax-ws

我无法访问网址http://localhost:8080/mn_webapp/CustomerService?wsdl

使用以下配置:

@Configuration
@ImportResource({ "classpath:META-INF/cxf/cxf.xml"})
public class ContextConfig extends SpringBootServletInitializer {   
    @Bean 
    public ServletRegistrationBean dispatcherServlet() {        
        return new ServletRegistrationBean(new CXFServlet(), "/*"); 
    } 
    @Autowired
    private Bus cxfBus;     
    @Bean 
    public EndpointImpl endpoint() { 
        EndpointImpl endpoint = new EndpointImpl(cxfBus, applicationContext.getBean(IWCustomerService.class) ); 
        endpoint.publish("/CustomerService"); 
        return endpoint; 
    }     
}

和web.xml

  <context-param>
      <param-name>contextClass</param-name>
      <param-value>   
   org.springframework.web.context.support.AnnotationConfigWebApplicationContext
      </param-value>
  </context-param>
  <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>com.dev.core.init.ContextConfig</param-value>
  </context-param>        
  <listener>  
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  
     </listener>    

似乎从不调用dispatcherServlet()和endpoint()?

0 个答案:

没有答案