我检查了几个其他类似的问题,但没有找到解决方案.
所以我有配置了Web服务的spring boot项目:
@Configuration
public class WebServiceConfig {
@Autowired
private Bus bus;
@Bean
public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, new ServiceImpl());
endpoint.publish("/ws");
return endpoint;
}
}
Run Code Online (Sandbox Code Playgroud)
ServiceImpl,如:
@javax.jws.WebService(serviceName = "ServiceImpl", portName = "ServiceImplPort", targetNamespace = "http://serivce.com/", endpointInterface = "pac.service...")
public class ServiceImpl...
Run Code Online (Sandbox Code Playgroud)
服务很好.
我的POM实现如下:
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-ws</artifactId>
<version>1.3.5.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.1.7</version>
</dependency>
...
Run Code Online (Sandbox Code Playgroud)
MainClass:
@Configuration
@EnableAutoConfiguration
@EnableScheduling
@EnableWebMvc
@ComponentScan("com.package")
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) throws Exception { …Run Code Online (Sandbox Code Playgroud)