package a;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.alex.core.kit.SignUtils;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import a.WsInterfaceServiceImplServiceStub.GetCompanyJsonListE;
import a.WsInterfaceServiceImplServiceStub.GetCompanyJsonListResponseE;
import a.WsInterfaceServiceImplServiceStub.GetGasInfoJsonListE;
import a.WsInterfaceServiceImplServiceStub.GetGasInfoJsonListResponseE;
import a.WsInterfaceServiceImplServiceStub.GetGasTabJsonE;
import a.WsInterfaceServiceImplServiceStub.GetGasTabJsonResponseE;
import a.WsInterfaceServiceImplServiceStub.GetAddGasRecordE;
import a.WsInterfaceServiceImplServiceStub.GetAddGasRecordResponseE;
public class GyWebserviceUtil {
public String GyGasList(String sydwid) {
try {
if (sydwid != null && !"".equals(sydwid)) {
String url = "http://47.104.137.250:10010/Port_Manage/services/HeBeiInterface";
String url2 = "http://127.0.0.1:9090/Port_Manage/services/HeBeiInterface";
String url666 = "http://192.168.6.169:8080/jeecg-boot/ws/interface";
String url3 = "http://118.190.105.19:8080/Port_Manage/services/HeBeiInterface";
WsInterfaceServiceImplServiceStub as = new WsInterfaceServiceImplServiceStub(url666);
as._getServiceClient().getOptions()
.setProperty(org.apache.axis2.Constants.Configuration.DISABLE_SOAP_ACTION, true);
WsInterfaceServiceImplServiceStub.GetAddGasRecord getlist = new WsInterfaceServiceImplServiceStub.GetAddGasRecord();
getlist.setIn0(sydwid);
GetAddGasRecordE getlistE = new GetAddGasRecordE();
getlistE.setGetAddGasRecord(getlist);
GetAddGasRecordResponseE gr14 = as.getAddGasRecord(getlistE);
String rtStr = gr14.getGetAddGasRecordResponse().get_return();
return rtStr;
} else
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException {
GyWebserviceUtil web = new GyWebserviceUtil();
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
Map<String, Object> qq = new HashMap<String, Object>();
qq.put("Sydw", "c6d7cb4deeac411cb3384b1b31278596");
qq.put("czTime", "2020/08/20 00:00:01");
qq.put("personName", "04EB3502675A801");
qq.put("gasId", "1295166865324593154");
qq.put("personId", "030022");
qq.put("deviceId", "030022");
qq.put("gunId", "030022");
qq.put("czl", "030022");
qq.put("MEDIA", "氧气");
String jsonString = JSON.toJSONString(qq);
String sign = SignUtils.getSingns(jsonString, "F0EE93D788DBD974C426DB71C473171A");
qq.put("sign", sign);
jsonString = JSON.toJSONString(qq);
String a = web.GyGasList(jsonString);
// String a = web.GyGasList(“c6d7cb4deeac411cb3384b1b31278596”);
System.out.println(a);
}
}
idea wsdl生成后调用方式
因篇幅问题不能全部显示,请点此查看更多更全内容