开发者

Deploy a class instance as a web service

I need to programmatically register a specific instance of an interface as a web service. (The reason is that its a dynamically generated implementation using proxies.)

Something like the following:

public <T, U extends T> void registerWebService(U implementation, Class<T> interfaceType);

related question here Starting an axis2 service programmatical开发者_JAVA技巧ly


(Feel free to edit, the answer is not complete:)

One way forward may be to use Axis' XFireExporter

public <T, U extends T> void registerWebService(U implementation, Class<T> interfaceType) {
        XFire xfire = XFireFactory.newInstance().getXFire();
        XFireExporter e = new XFireExporter();
        e.setXfire(xfire);
        e.setServiceInterface(interfaceType);
        e.setServiceBean(implementation);
        e.afterPropertiesSet();
        e.getServiceBean();
//TODO: register with a WebApplicationContext somehow.
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜