package com.wteam.framework.common.utils;

import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import java.io.ByteArrayInputStream;
import java.security.KeyStore;

public class WeChatUtil {


    /**
     * 字符串转为对象
     *
     * @param xml   json字符串
     * @param clazz
     */
    public static Object xmlToPojo(String xml, Class<?> clazz) {
        try {
            JAXBContext context = JAXBContext.newInstance(clazz);
            Unmarshaller umMarshaller = context.createUnmarshaller();
            Object pojo = umMarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes("utf-8")));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;

    }
}