1. XML Utils 类:
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.Namespace;
import org.dom4j.QName;
import org.dom4j.XPath;
import org.springframework.stereotype.Component;
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
@Component
public class XmlUtils {
/** 通过xml模板生产报文字符串 UTF-8 **/
public String genrateMsgFromXml(Map<String, String> content,String templateFileName) throws IOException,TemplateException{
String templatePath = "/templetes/"; // 报文模板路径
String requestXml = ""; // 请求报文
Configuration config = new Configuration(Config