如果以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. 億万笑者 - Radwimps

    億万笑者 作曲:野田洋次郎 作词:野田洋次郎 明日に希望を持った者だけに 絶望があるんだ何かを信じた者だけに 裏切りはあるんだ勇者だけに与えられた 名誉の負傷とでも言うのかそれにしてはずいぶんと 割に ...

  2. 关于清除丢失贴图与IES文件

    fn YY_clrmessingmaps = ( YY_messingmap = #() allBitmaps = getClassInstances BitmapTexture -- 所有材质 to ...

  3. CSS 样式的优先级

    1. 同一元素引用了多个样式时,排在后面的样式属性的优先级高 例如,下面的 div,同时引用了 [.default] 和 [.user] 中的样式,其中 [.user] 样式中的 width 属性会替 ...

  4. 用minidwep-gtk研究wifi

    全图,不解释

  5. javascript获取iframe框架中页面document对象,获取子页面里面的内容,iframe获取父页面的元素,

    javascript获取iframe框架中,加载的页面document对象 因为浏览器安全限制,对跨域访问的页面,其document对象无法读取.设置属性 function getDocument(i ...

  6. 数据库之mysql存储程序

    什么时候会用到存储过程 1.存储过程只在创造时进行编译,以后每次执行存储过程都不需再重新编译,而一般 SQL 语句每执行一次就编译一次,所以使用存储过程可提高数据库执行速度2.当对数据库进行复杂操作时 ...

  7. IntelliJ IDEA 环境配置

    0. 下载 jdk 用于 java developer kit  下载地址 见 rj.baidu.com 1. 从百度 网盘下载 ideaIU-2016.2.5.exe 并安装在window上 2. ...

  8. bzoj4617: [Wf2016]Spin Doctor

    Description 大选要到了,受候选人X的要求,你调查了n个人,并记录了每个人的3个信息: ai--他们能记忆π的多少位 bi--他们的头发数量 ci--他们是否会给候选人X投票 你需要找到某个 ...

  9. Linux下删除空文件,删除指定大小的文件

    Linux下批量删除空文件(大小等于0的文件)的方法: find . -name "*" -type f -size 0c | xargs -n 1 rm -f 用这个还可以删除指 ...

  10. HTML 事件属性_03

    全局事件属性 HTML 4 的新特性之一是可以使 HTML 事件触发浏览器中的行为,比方说当用户点击某个 HTML 元素时启动一段 JavaScript. 如果你想学习更多关于事件属性,请访问 Jav ...