【发布时间】:2016-07-18 11:07:23
【问题描述】:
我正在尝试使用spring-boot 发布webservice
这是我的设置方式。
我有一个interface 有一些methods 说
@WebService
public interface FirstInterface
{
@WebMethod
void method1(@WebParam(name = "id") String id);
void method2(@WebParam(name = "id2") String id);
}
我还有另一个interface,还有更多methods
它扩展了FirstInterface
@WebService
public interface SecondInterface extends FirstInterface
{
@WebMethod
void method3(@WebParam(name = "id") String id);
void method4(@WebParam(name = "id2") String id);
}
现在我有一个实现类,它实现了SecondInterface
并且有一个endpointInterface 指的是我的SecondInterface 是这样的:
@Service
@WebService(endpointInterface = "com.somepackage.SecondInterface")
public class CallBackServicesImpl implements SecondInterface
{
@Override
//override all four methods here
}
现在我有一个发布这些服务的配置类
@Configuration
public class WebServiceConfig
{
@Bean
public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(springBus(), serviceImpl());
endpoint.publish(SERVICE_NAME_PATH);
return endpoint;
}
}
问题:webservice 使用此设置发布,endpointinterface 指向 FirstInterface,但只有两种方法可供使用。
现在我都希望有四种方法可供客户端使用,所以我将endpointinterface 指向SecodInterface,它开始抛出异常说Error creating bean with name 'endpoint',org.apache.cxf.service.factory.ServiceConstructionException
我在这里缺少一些基本的东西吗?我怎样才能实现这种行为?
【问题讨论】:
标签: web-services spring-boot cxf jax-ws