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());
}
原文地址:https://www.cnblogs.com/xiaoyu1994/p/8567539.html