赞
踩
海康接口为例:
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"xmlns:tns="http://www.hikvision.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="queryData" targetNamespace="http://www.hikvision.com/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.hikvision.com/" elementFormDefault="unqualified"targetNamespace="http://www.hikvision.com/" version="1.0">
<xs:element name="login" type="tns:login"/>
<xs:element name="loginResponse" type="tns:loginResponse"/>
<xs:element name="logout" type="tns:logout"/>
<xs:element name="logoutResponse" type="tns:logoutResponse"/>
<xs:element name="queryIntellData" type="tns:queryIntellData"/>
<xs:element name="queryIntellDataResponse" type="tns:queryIntellDataResponse"/>
<xs:element name="updateIntellData" type="tns:updateIntellData"/>
<xs:element name="updateIntellDataResponse" type="tns:updateIntellDataResponse"/>
<xs:complexType name="logout">...</xs:complexType>
<xs:complexType name="logoutResponse">...</xs:complexType>
<xs:complexType name="queryIntellData">...</xs:complexType>
<xs:complexType name="queryIntellDataResponse">...</xs:complexType>
<xs:complexType name="updateIntellData">...</xs:complexType>
<xs:complexType name="updateIntellDataResponse">...</xs:complexType>
<xs:complexType name="login">...</xs:complexType>
<xs:complexType name="loginResponse">...</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="logout">...</wsdl:message>
<wsdl:message name="logoutResponse">...</wsdl:message>
<wsdl:message name="loginResponse">...</wsdl:message>
<wsdl:message name="updateIntellData">...</wsdl:message>
<wsdl:message name="queryIntellDataResponse">...</wsdl:message>
<wsdl:message name="updateIntellDataResponse">...</wsdl:message>
<wsdl:message name="queryIntellData">...</wsdl:message>
<wsdl:message name="login">...</wsdl:message>
<wsdl:portType name="queryData">...</wsdl:portType>
<wsdl:binding name="queryDataSoapBinding" type="tns:queryData">...</wsdl:binding>
<wsdl:service name="queryData">...</wsdl:service>
</wsdl:definitions>
命名空间:
targetNamespace="http://www.hikvision.com/"
调用方法名(带前缀): tns:queryIntellData
<xs:element name="queryIntellData" type="tns:queryIntellData"/>
java代码调用:
Map<String, Object> 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);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。