webservice服务利用hutool工具调用wsdl超简单

海康接口为例:

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

 

命名空间:

targetNamespace="http://www.hikvision.com/"

调用方法名(带前缀):  tns:queryIntellData

java代码调用:

Map params = new HashMap<>();
JSONObject jsonObject = new JSONObject();
jsonObject.put("token", "XXX");
jsonObject.put("startTime", "2020-11-10 00:00:00");
jsonObject.put("endTime", "2020-12-22 00:00:00");
params.put("queryJson", JSON.toJSONString(jsonObject));
params.put("orderType", "DESC");
params.put("orderField", "collectTime");
params.put("pageSize", 10000);
params.put("pageNo", 0);

SoapClient soapClient = SoapClient.create("接口地址")
        .setMethod("tns:queryIntellData", "http://www.hikvision.com/")
        .setParams(params, false);//false不带前缀
String send = soapClient.send(true);
System.out.println(send);

你可能感兴趣的:(hutool,java,wsdl,webservice,接口,hutool,wsdl,java)