简单webservice rpc 客户端

package com.ai.prm.sync;




import com.ai.axis2.service.proxy.rpc.RPCProxy;
import com.ai.axis2.service.proxy.rpc.RPCProxyService;
import  SyncInfoResponse;
import  SyncProductStatusRequest;



public class TestClient {


public static void main(String[] args) {
syncProductStatus();
}

/**
 * 产品状态回传
 * @param request
 * @return
 */
public static void syncProductStatus(){
String url = "http://127.0.0.1:8080/crmx/services/SyncPService";
String nameSpaceValue = "http://service.abc";
String method = "syncProductStatusFeedbackService";

SyncProductStatusRequest request = new SyncProductStatusRequest();
request.setPartyID("31660");
request.setProductID("9051096000");
request.setProductStatus(4);
request.setRecordSequenceID("123123123");
request.setUpdateType(2);


Object[] inputParam = new Object[]{request};
Class[] returnClass = new Class[]{SyncInfoResponse.class};
RPCProxy rpcProxy = new RPCProxy(url, nameSpaceValue, method, 
inputParam, returnClass );
RPCProxyService client = new RPCProxyService();
Object[] result = client.send(rpcProxy);

SyncInfoResponse response = (SyncInfoResponse) result[0];
System.out.println(CheckLog.getMethodName(response));


}

}

相关文章
相关标签/搜索