如果以GET或POST请求某个系统返回,带有 $#x 那很有可能是axis服务器返回的.

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><validateInvoiceResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><validateInvoiceReturn xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">{&quot;returncode&quot;:&quot;10006&quot;,&quot;returnmsg&quot;:&quot;未获取到交易机构信息&quot;,&quot;fpdm&quot;:&quot;null&quot;,&quot;fphm&quot;:&quot;null&quot;,&quot;kprq&quot;:&quot;null&quot;}
</validateInvoiceReturn></validateInvoiceResponse></soapenv:Body></soapenv:Envelope>

实际内容:

{&quot;returncode&quot;:&quot;10006&quot;,&quot;returnmsg&quot;:&quot;未获取到交易机构信息&quot;,&quot;fpdm&quot;:&quot;null&quot;,&quot;fphm&quot;:&quot;null&quot;,&quot;kprq&quot;:&quot;null&quot;}

参考 http://www.iteye.com/problems/73011

$$$$$ 使用dom4j可解析它

    public static void main(String[] args) throws Exception {
String retXml = readStringFromFile("d://a.txt","GBK");//你刚得到的返回报文 Document document = DocumentHelper.parseText(retXml); OutputFormat format = OutputFormat.createPrettyPrint();
StringWriter sw = new StringWriter();
XMLWriter xw = new XMLWriter(sw, format);
xw.setEscapeText(false);
xw.write(document);
xw.flush(); String finalRetXml = sw.toString();
System.out.println("最终返回报文:\n"+finalRetXml);
}

最终得到:

文件 d://a.txt存在与否?: true
读到的文件内容如下:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><validateInvoiceResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><validateInvoiceReturn xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">{&quot;returncode&quot;:&quot;10006&quot;,&quot;returnmsg&quot;:&quot;未获取到交易机构信息&quot;,&quot;fpdm&quot;:&quot;null&quot;,&quot;fphm&quot;:&quot;null&quot;,&quot;kprq&quot;:&quot;null&quot;}</validateInvoiceReturn></validateInvoiceResponse></soapenv:Body></soapenv:Envelope>
最终返回报文:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<validateInvoiceResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<validateInvoiceReturn xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:string">{"returncode":"10006","returnmsg":"未获取到交易机构信息","fpdm":"null","fphm":"null","kprq":"null"}</validateInvoiceReturn>
</validateInvoiceResponse>
</soapenv:Body>
</soapenv:Envelope>

最新文章

  1. 电路相关知识--读&lt;&lt;继电器是如何成为CPU的&gt;&gt;
  2. inner join on, left join on, right join on的区别与介绍
  3. LeetCode 6 ZigZag Conversion(规律)
  4. (C#) 创建单元测试(Unit Test).
  5. 网络编辑基础:对HTTP协议的头信息详解
  6. 12. leetcode 455.Assign Cookies
  7. EMC CX4-480服务器raid磁盘数据恢复案例
  8. packer的基本使用
  9. html中layui+jfinal模板实现前端搜索功能
  10. printf scanf cin cout的区别与特征
  11. bootstrap table使用及遇到的问题
  12. Django-基础-2-ORM
  13. 基础选择器,长度与颜色,标签display,嵌套关系,盒模型,盒模型布局
  14. linux常见基本命令
  15. js 迭代 方法
  16. BZOJ4078 WF2014Metal Processing Plant(二分答案+2-SAT)
  17. system函数的应用一例
  18. ARPG游戏打击感相关的技术简单总结
  19. SQL语句优化 (二) (53)
  20. 在web.xml中添加servlet报错问题

热门文章

  1. [dijkstra+heap优化] 模板
  2. 升级vs工程到vs2010(以上)工程找不到OutputDebugStr报错
  3. Struts2 Action中的方法命名不要以get开头
  4. 黑马程序员——JAVA基础之装饰设计模式
  5. elasticsearch的marvel
  6. MapReduce 2简介
  7. Oracle调整联机日志大小
  8. Windows环境下使用Redis缓存工具的图文详细方法
  9. Google Tensorflow 源码编译(一):Protobuf&lt;v3.0.0-alpha-3&gt;
  10. Asp.net MVC 之异常处理