webservice 客户端调用

/**
* 通过webserevice下发工单
* @param url
* @param method
* @param requestMap
* @return
* @throws ServiceException
* @throws MalformedURLException
* @throws RemoteException
*/
public static String callWebService(String url, String method, Map<String, String> requestMap) throws ServiceException, MalformedURLException, RemoteException {

String endpoint = url;
Service service = new Service();
Call call = (Call) service.createCall();
Set<String> set = requestMap.keySet();

call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);// 设置返回类型
call.setUseSOAPAction(true);
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(method);
return (String) call.invoke(requestMap.values().toArray());
}
posted @ 2018-03-14 14:51  步步丶惊云  阅读(309)  评论(0编辑  收藏  举报