cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liw <pattiew...@yahoo.com>
Subject Which API can be used to get service interface class for a given service?
Date Wed, 08 Jul 2009 04:40:03 GMT

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--tp24385234p24385234.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message