Spring boot CXF webservice integration problems encountered and solutions

Spring boot integrate CXF web service development problems encountered:

  1, after successful integration cxf, found that only webservice service can be used normally, all other requests url can not access normal.

  Solution: In the configuration class WebServiceConfig.java publishing service, change the name of this method:

@Bean
public ServletRegistrationBean dispatcherServlet() 

  Read:

@Bean 
    public ServletRegistrationBean disServlet () { 
        return new new ServletRegistrationBean (new new CXFServlet (), "/ Service / *"); // publishing service name 
    }

  You can successfully access other url

  Because the public ServletRegistrationBean dispatcherServlet () to overwrite the default mapping, to get rid of the name, the control method will be able to visit the class.

  After you change this invention can be normal method other request url, webservice service is also normal.

  Source: https://blog.csdn.net/hawako/article/details/80556676

 

 

Guess you like

Origin www.cnblogs.com/Big-Boss/p/11912679.html