package com.accu.business.pms.webservice;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.XMLType;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import com.accu.common.util.FileUtils;
public class MesureDeviceWebServiceDAS {
public static String queryMesureDevice(String commond, String guidStationId){
String result = “”;
try {
Service service = new Service();
Call call = (Call) service.createCall();
call.setOperationName(new QName(“”, “changeMesureDevice”));
call.addParameter(“commond”, XMLType.XSD_STRING, ParameterMode.IN);
call.setTargetEndpointAddress(new URL( FileUtils.getProperties(“accuwebservice”,”mesureDeviceWebServiceDAS”+guidStationId)));
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
result=(String)call.invoke(new Object[] {commond});
} catch (Exception e) {
e.printStackTrace();
result = “error”;
}
return result;
}
public static String queryMesureParam(String commond, String guidStationId){
String result = “”;
try {
Service service = new Service();
Call call = (Call) service.createCall();
call.setOperationName(new QName(“”, “changeMesureParam”));
call.addParameter(“commond”, XMLType.XSD_STRING, ParameterMode.IN);
call.setTargetEndpointAddress(new URL( FileUtils.getProperties(“accuwebservice”,”mesureDeviceWebServiceDAS”+guidStationId)));
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
result=(String)call.invoke(new Object[] {commond});
} catch (Exception e) {
e.printStackTrace();
result = “error”;
}
return result;
}
/* public static Boolean queryMesureDevice(String stationId){
Boolean result = true;
MesureDeviceWebService rdrw = pws.getServiceClass();
try {
MetersMapper mmapper = SpringContextHolder.getBeanbyClass(MetersMapper.class);
List<Meters> metersList = mmapper.getMesureDeviceByStationId(stationId);
rdrw.changeMesureDevice(metersList);
} catch (Exception e) {
e.printStackTrace();
result = false;
}
return result;
}
public static Boolean queryMesureParam(String stationId){
Boolean result = true;
MesureDeviceWebService rdrw = pws.getServiceClass();
try {
MeasureParamMapper mpMapper = SpringContextHolder.getBeanbyClass(MeasureParamMapper.class);
List<MeasureParam> measureParamList = mpMapper.getMesureParamByStationId(stationId);
rdrw.changeMesureParam(measureParamList);
} catch (Exception e) {
e.printStackTrace();
result = false;
}
return result;
}*/
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/11288.html