CXF Web 服务和多个服务端点
我对使用 Spring Boot 的 CXF 和 JAX-WS 很陌生。到目前为止,我有一个带有一个端点的服务,但接下来我想通过发布新端点来将另一个端点添加到同一服务,因为
@Configuration
public class CXFSvcConfig
{
@Autowired
protected Bus bus;
@Bean
@ConditionalOnMissingBean
public Service mySvc()
{
return new Service();
}
@Bean
@ConditionalOnMissingBean
public Endpoint testService1()
{
final EndpointImpl endpoint = new EndpointImpl(bus, mySvc());
endpoint.publish("/Service1");
return endpoint;
}
@Bean
@ConditionalOnMissingBean
public Endpoint testService2()
{
final EndpointImpl endpoint2 = new EndpointImpl(bus, mySvc());
endpoint2.publish("/Service2");
return endpoint2;
}
}
/Service1
端点将正常工作(将显示 WSDL),但 /当我希望看到与
将抛出 /Service1
相同的 WSDL 时,Service2Service not found
我做错了什么?
I'm new to the CXF and JAX-WS using with Spring Boot. So far I have a service with one endpoint but as next I want to add another endpoint to the same service by publishing new endpoint as
@Configuration
public class CXFSvcConfig
{
@Autowired
protected Bus bus;
@Bean
@ConditionalOnMissingBean
public Service mySvc()
{
return new Service();
}
@Bean
@ConditionalOnMissingBean
public Endpoint testService1()
{
final EndpointImpl endpoint = new EndpointImpl(bus, mySvc());
endpoint.publish("/Service1");
return endpoint;
}
@Bean
@ConditionalOnMissingBean
public Endpoint testService2()
{
final EndpointImpl endpoint2 = new EndpointImpl(bus, mySvc());
endpoint2.publish("/Service2");
return endpoint2;
}
}
/Service1
endpoint will work fine (will display WSDL) but /Service2
will throw Service not found
when I will expect to see the same WSDL as is for /Service1
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论