zouyu
2023-11-15 c9db22f6ccb6a6d66e38dec09807e88b160f29e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.chinaztt.mes.mould.util;
 
import cn.hutool.json.JSONObject;
import cn.hutool.json.XML;
import org.apache.commons.lang3.StringUtils;
 
/**
 * @Author: Zero
 * @Date: 2022/12/2 09:37
 * @Description:
 */
public class SoapUtil {
 
    public static String parseReadTempCollectionRecordResult(String result) {
        if (StringUtils.isBlank(result)) {
            return StringUtils.EMPTY;
        }
        JSONObject data = XML.toJSONObject(result);
        return data.getJSONObject("soap:Envelope").getJSONObject("soap:Body").getJSONObject(
                "Read_temp_collection_recordResponse").get("Read_temp_collection_recordResult").toString();
    }
 
    public static String parseInsertTempLifeRecordResult(String result) {
        if (StringUtils.isBlank(result)) {
            return StringUtils.EMPTY;
        }
        JSONObject data = XML.toJSONObject(result);
        return data.getJSONObject("soap:Envelope").getJSONObject("soap:Body").getJSONObject(
                "Insert_temp_life_recordResponse").get("Insert_temp_life_recordResult").toString();
    }
}