公司网站设计公司,南京注册公司,wordpress ssl视频讲解,两个wordpress共享账户对接前置篇#xff1a;
【SF顺丰】顺丰开放平台API对接#xff08;注册、API测试篇#xff09;_顺丰api接口对接指南-CSDN博客
1.实现效果展示 2.SF顺丰开放平台#xff0c;JDK资源下载。 下载地址#xff1a;顺丰开放平台
3.将下载的JDK放入项目中。 4.将JDK资源引入p…对接前置篇
【SF顺丰】顺丰开放平台API对接注册、API测试篇_顺丰api接口对接指南-CSDN博客
1.实现效果展示 2.SF顺丰开放平台JDK资源下载。 下载地址顺丰开放平台
3.将下载的JDK放入项目中。 4.将JDK资源引入pom.xml文件中。
!-- 顺丰丰桥 SDK --
dependencygroupIdcom.sf/groupIdartifactIdSF-CSIM-EXPRESS-SDK/artifactIdversion2.1.7/versionscopesystem/scopesystemPath${project.basedir}/lib/SF-CSIM-EXPRESS-SDK-V2.1.7.jar/systemPath
/dependency 注项目启动pom.xml文件中配置打包将外部SDK引入项目包中否则发布后依然是失效。
buildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactIdconfiguration!-- 在打包时将引用的外部jar引入到当前项目包中 --forktrue/forkincludeSystemScopetrue/includeSystemScope/configuration/plugin/plugins
/build
5.测试DEMO
接下来是一个详细的示例演示如何使用顺丰丰桥API进行路由信息查询。 顺丰丰桥Api参考文档顺丰开放平台
public class SFTestDemo {private static final String CLIENT_CODE 替换自己应用的顾客编码; //顾客编码//沙箱环境的地址private static final String CALL_URL_BOX https://sfapi-sbox.sf-express.com/std/service;//请求接口private static final String CHECK_WORD_BOX 替换自己应用的沙箱校验码;//沙箱校验码//生产环境的地址private static final String CALL_URL_PROD https://sfapi.sf-express.com/std/service;//请求接口private static final String CHECK_WORD 替换自己的应用的生产校验码;//生产校验码/*** 查询顺丰路由信息* p* 顺丰快递单号* 收件人手机号后四位** return* throws UnsupportedEncodingException*/public static void main(String[] args) throws UnsupportedEncodingException {IServiceCodeStandard standardService ExpressServiceCodeEnum.EXP_RECE_SEARCH_ROUTES;//路由查询String timeStamp String.valueOf(System.currentTimeMillis());//时间戳CallExpressServiceTools tools CallExpressServiceTools.getInstance();//数字签名API文档有说明// set common headerMapString, String params new HashMapString, String();//封装查询msgData数据MapString, Object map new HashMap();ListString list new ArrayList();list.add(替换自己顺丰单号);map.put(language, 0);map.put(trackingType, 1);map.put(methodType, 1);map.put(trackingNumber, list);map.put(checkPhoneNo, 替换快递单手机号后四位);String msgData JSONObject.toJSONString(map);// params.put(Content-type, application/x-www-form-urlencoded);params.put(partnerID, CLIENT_CODE); // 顾客编码params.put(requestID, UUID.randomUUID().toString().replace(-, ));params.put(serviceCode, standardService.getCode());// 接口服务码params.put(timestamp, timeStamp);params.put(msgData, msgData);params.put(msgDigest, tools.getMsgDigest(msgData, timeStamp, CHECK_WORD));String result HttpClientUtil.post(CALL_URL_PROD, params);System.out.println(调用地址 CALL_URL_PROD);System.out.println(顾客编码 CLIENT_CODE);System.out.println(返回结果 result);}
}