顺丰电子面单接口参数及对接案例1.接口描述1)接口支持的消息接收方式:HTTPPOST2)请求方法的编码格式(utf-8):"application/x-www-form-urlencoded;charset=utf-8"3)API地址:http://api.kdniao.cc/Ebusiness/EbusinessOrderHandle.aspx4)面单所属快递:顺丰5)接口提供:快递鸟2.请求系统级参数备注:R-必填(Required),O-可选(Optional),C-报文中该参数在一定条件下可选(Conditional)。3.接口参数1)请求内容字段定义2)返回参数定义4.JAVA对接源码importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStreamReader;importjava.io.OutputStreamWriter;importjava.io.UnsupportedEncodingException;importjava.net.HttpURLConnection;importjava.net.URL;importjava.net.URLEncoder;importjava.util.HashMap;importjava.util.Map;importcom.sun.org.apache.xerces.internal.impl.dv.util.Base64;importjava.security.MessageDigest;/****快递鸟电子面单接口*ID和Key请到官网申请:http://www.kdniao.com/ServiceApply.aspx*/publicclassKdGoldAPIDemo{//电商IDprivateStringEBusinessID="ID请到快递鸟官网申请";//电商加密私钥,快递鸟提供,注意保管,不要泄漏privateStringAppKey="KEY请到快递鸟官网申请";//请求url,正式环境地址:http://api.kdniao.cc/api/EorderserviceprivateStringReqURL="http://testapi.kdniao.cc:8081/api/Eorderservice";/***Json方式电子面单*@throwsException*/publicStringorderOnlineByJson()throwsException{StringrequestData="{'OrderCode':'118060839871',"+"'ShipperCode':'SF',"+"'PayType':1,"+"'ExpType':1,"+"'Cost':1.0,"+"'OtherCost':1.0,"+"'Sender':"+"{"+"'Company':'LV','Name':'Taylor','Mobile':'15018442396','ProvinceName':'上海','CityName':'上海','ExpAreaName':'青浦区','Address':'明珠路73号'},"+"'Receiver':"+"{"+"'Company':'GCCUI','Name':'Yann','Mobile':'15018442396','ProvinceName':'北京','CityName':'北京','ExpAreaName':'朝阳区','Address':'三里屯街道雅秀大厦'},"+"'Commodity':"+"[{"+"'GoodsName':'鞋子','Goodsquantity':1,'GoodsWeight':1.0}],"+"'Weight':1.0,"+"'Quantity':1,"+"'Volume':0.0,"+"'Remark':'小心轻放',"+"'IsReturnPrintTemplate':1}";Map<String,String>params=newHashMap<String,String>();params.put("RequestData",urlEncoder(requestData,"UTF-8"));params.put("EBusinessID",EBusinessID);params.put("RequestType","1007");StringdataSign=encrypt(requestData,AppKey,"UTF-8");params.put("DataSign",urlEncoder(dataSign,"UTF-8"));params.put("DataType","2");Stringresult=sendPost(ReqURL,params);//根据公司业务处理返回的信息......returnresult;}/***MD5加密*@paramstr内容*@paramcharset编码方式*@throwsException*/@SuppressWarnings("unused")privateStringMD5(Stringstr,Stringcharset)throwsException{MessageDigestmd=MessageDigest.getInstance("MD5");md.update(str.getBytes(charset));byte[]result=md.digest();StringBuffersb=newStringBuffer(32);for(inti=0;i<result.length;i++){intval=result[i]&0xff;if(val<=0xf){sb.append("0");}sb.append(Integer.toHexString(val));}returnsb.toString().toLowerCase();}/***base64编码*@paramstr内容*@paramcharset编码方式*@throwsUnsupportedEncodingException*/privateStringbase64(Stringstr,Stringcharset)throwsUnsupportedEncodingException{Stringencoded=Base64.encode(str.getBytes(charset));returnencoded;}@SuppressWarnings("unused")privateStringurlEncoder(Stringstr,Stringcharset)throwsUnsupportedEncodingException{Stringresult=URLEncoder.encode(str,charset);returnresult;}/***电商Sign签名生成*@paramcontent内容*@paramkeyValueAppkey*@paramcharset编码方式*@throwsUnsupportedEncodingException,Exception*@returnDataSign签名*/@Suppre...