SAP接口请求统一格式化
This commit is contained in:
parent
c3eea47b69
commit
e8a54788a0
@ -17,11 +17,12 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class SapUtil {
|
||||
|
||||
/*private static final String sapUrl = "http://vhhzwds4ci.sap.nalinv.com:8000/sap/bc/center/tbus?sap-client=110";
|
||||
private static final String sapUser = "RFC";
|
||||
private static final String sapPassword = "Admin@1234567890";*/
|
||||
// private static final String sapUrl = "http://vhhzwds4ci.sap.nalinv.com:8000/sap/bc/center/tbus?sap-client=110";
|
||||
private static final String sapUrl = "/sap/bc/center/tbus?sap-client=110";
|
||||
// private static final String sapUser = "RFC";
|
||||
// private static final String sapPassword = "Admin@1234567890";
|
||||
|
||||
private static final String sapUrl = "http://47.103.63.63/sap/pip";
|
||||
private static final String WbpUrl = "http://47.103.63.63/sap/pip";
|
||||
private static final String sapUser = "RFC";
|
||||
private static final String sapPassword = "Admin@1234567890";
|
||||
|
||||
@ -30,6 +31,7 @@ public class SapUtil {
|
||||
allJson.put("API_METHOD", "POST");
|
||||
JSONObject json = JSONObject.parseObject(jsonStr);
|
||||
allJson.put("API_DATA", json);
|
||||
allJson.put("API_PATH", sapUrl);
|
||||
return allJson.toJSONString();
|
||||
}
|
||||
|
||||
@ -37,6 +39,7 @@ public class SapUtil {
|
||||
JSONObject allJson = new JSONObject();
|
||||
allJson.put("API_METHOD", "POST");
|
||||
allJson.put("API_DATA", jsonObj);
|
||||
allJson.put("API_PATH", sapUrl);
|
||||
return allJson;
|
||||
}
|
||||
|
||||
@ -47,7 +50,7 @@ public class SapUtil {
|
||||
// 禁用 SSL 验证
|
||||
SSLUtil.disableCertificateValidation();
|
||||
// 创建 URL 对象
|
||||
URL url = new URL(sapUrl);
|
||||
URL url = new URL(WbpUrl);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setDoOutput(true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user