我的组件具有复杂的接口与接受非原始数据或简单 POJO 的操作。
将此组件接口转换为可供 java 和非 java 客户端使用的标准 Web 服务接口的最佳实践(方式/方法)是什么,以便服务使用者可以使用 WSDL 毫无问题地生成类。
可以按原样使用吗?如果没有,有没有办法在不影响操作行为的情况下最小化改变它?
组件接口有如下操作:
/** This is asynchronous method that needs to callback the ResultHandler
interface which has to be implemented by the component user to handle
operationOne result **/
public void operationOne(int id, ResultHandler handler);
/** I think there is no problem with the following operation for Web Services,
when using data contracts. Correct me if I’m wrong! **/
public String operationTwo(int id, MyObject obj);
ResultHandler 接口:
/** Note that this handler interface contains InputStream
and Exception as parameters for the handling methods **/
interface ResultHandler {
void onComplete(InputStream is);
void onFailure(IOException ioEx);
}