merge
This commit is contained in:
+33
-2
@@ -811,7 +811,17 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//전문에서 추출한 httpHeader값 외 어댑터에서 최종적으로 적용되도록,
|
//전문에서 추출한 httpHeader값 외 어댑터에서 최종적으로 적용되도록,
|
||||||
String httpSettingJsonStr = prop.getProperty( HTTP_HEADER_SETTING , "{}");
|
String httpSettingJsonStr = prop.getProperty( HTTP_HEADER_SETTING );
|
||||||
|
|
||||||
|
if( StringUtils.isBlank(httpSettingJsonStr) )
|
||||||
|
{
|
||||||
|
if( logger.isInfoEnabled() ) {
|
||||||
|
logger.info("HTTP_HEADER_SETTING value is not JSONObject Type, skip.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSONObject httpValues = (JSONObject) JSONValue.parse(httpSettingJsonStr);
|
JSONObject httpValues = (JSONObject) JSONValue.parse(httpSettingJsonStr);
|
||||||
|
|
||||||
@@ -978,6 +988,16 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (eaiBody instanceof JSONObject) {
|
||||||
|
JSONObject jsonObject = (JSONObject) eaiBody;
|
||||||
|
if( jsonObject.containsKey("KJB_ROOTLESS_ARRAY") ) {
|
||||||
|
ContentType contentTypeObj = ContentType.create(contentType, charset);
|
||||||
|
JSONArray array = (JSONArray) jsonObject.get("KJB_ROOTLESS_ARRAY");
|
||||||
|
StringEntity entity = new StringEntity(array.toJSONString(), contentTypeObj);
|
||||||
|
method.setEntity(entity);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (StringUtils.contains(contentType, "application/x-www-form-urlencoded")) {
|
if (StringUtils.contains(contentType, "application/x-www-form-urlencoded")) {
|
||||||
if (eaiBody instanceof JSONObject) {
|
if (eaiBody instanceof JSONObject) {
|
||||||
@@ -1490,7 +1510,18 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (JSONObject) JSONValue.parse(message);
|
Object obj = JSONValue.parse(message);
|
||||||
|
|
||||||
|
if (obj instanceof JSONObject) {
|
||||||
|
return (JSONObject) obj;
|
||||||
|
} else if (obj instanceof JSONArray) {
|
||||||
|
// 배열일 경우 새로운 객체로 감싸서 반환
|
||||||
|
JSONObject wrapper = new JSONObject();
|
||||||
|
wrapper.put("KJB_ROOTLESS_ARRAY", obj);
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null; // 혹은 상황에 맞는 예외 처리
|
||||||
}
|
}
|
||||||
|
|
||||||
private Document convertXmlDocument(String message) throws Exception {
|
private Document convertXmlDocument(String message) throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user