前言
目前还有一些使用SAP服务,上一篇文章是使用hutool调用webservice的方法使用hutool调用webservice教程,本篇文章讲解使用httpClient调用webservice的方法
String xml="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:i=\"http://i.std.ei.iih/\">\n" +
" <soapenv:Header/>\n" +
" <soapenv:Body>\n" +
" <i:process>\n" +
" <code>SI0142</code>\n" +
"\t <xml>\n" +
"\t <![CDATA[\n" +
"<iihparam> \n" +
" <!--用户编码--> \n" +
" <Code_user>00000</Code_user> \n" +
" <!--科室编码--> \n" +
" <Code_dep>88</Code_dep> \n" +
" <!--外部编码--> \n" +
" <Code_external>IIH</Code_external> \n" +
" <Data> \n" +
" <!--分页信息--> \n" +
" <Pageinfos> \n" +
" <Pageinfo> \n" +
" <!--分页大小--> \n" +
" <Pagesize>10000</Pagesize> \n" +
" <!--页号--> \n" +
" <Pageindex>1</Pageindex> \n" +
" <!--页数--> \n" +
" <Pagecount></Pagecount> \n" +
" <!--总记录数--> \n" +
" <Recordscount></Recordscount> \n" +
" </Pageinfo> \n" +
" </Pageinfos> \n" +
" </Data> \n" +
"</iihparam>\n" +
" ]]>\n" +
"</xml>\n" +
" </i:process>\n" +
" </soapenv:Body>\n" +
"</soapenv:Envelope>";
//上面的xml可能会出现>变成>和<变成<的情况,所以我们需要替换一下
xml.replaceAll(">", ">").replaceAll("<", "<");
public static String httpQ