I found the solution. Using service.get() API solved the problem.
Thanks,
Li
liw wrote:
>
> Hi,
>
> We are migrating from xfire to cxf 2.1. We need to get the service
> interface class for a given serviceName.
>
> The following is what we have with xfire.
>
> XFire xfire = (XFire)BeanFactory.getBeanInstance("xfire");
> Service origRegisteredService =
> xfire.getServiceRegistry().getService(serviceName);
> Class serviceInterfaceClass =
> getXFireServiceObject(serviceName).getServiceInfo().getServiceClass();
>
>
> With cxf, I am able to get the service for a given serviceName using the
> following code.
>
> private Service getCXFServiceObject(String serviceName)
> {
> Bus bus = (Bus)BeanFactory.getBeanInstance(AppConstants.CXF_BUS);
> ServerRegistry serverRegistry =
> bus.getExtension(ServerRegistry.class);
> for (Server server : serverRegistry.getServers()) {
> Service service = server.getEndpoint().getService();
> if (service.getName().getLocalPart().equals(serviceName)) {
> return service;
> }
> }
> return null;
> }
>
> However, after I get the service, I am not able to find any cxf API to get
> service interface class for a given service.
>
> Does anyone have any idea?
>
> Thanks in advance,
>
> Li
>
>
>
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/Which-API-can-be-used-to-get-service-interface-class-for-a-given-service--tp24385234p24386921.html
Sent from the cxf-user mailing list archive at Nabble.com.