1、引入依赖
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.0.M2</version>
</dependency>
2、请求组装
String params=
"<BSXml>" +
" <MsgHeader>" +
"<Sender>RIS</Sender>" +
"<MsgType>CDR_5401</MsgType>" +
"<MsgVersion>3.0</MsgVersion>" +
"<OperationType>Quesry_Result</OperationType>" +
"<EffectiveTime>"+"20231212044208"+"</EffectiveTime>" +
" </MsgHeader>" +
" <MsgBody>" +
"<AuthorOrganization>91441400MA4UH38H20</AuthorOrganization>" +
"<VisitId>"+"231208020777"+"</VisitId>" +
" </MsgBody>" +
"</BSXml>";
logger.info("请求报文参数:"+ params);
cn.hutool.http.HttpResponse response = HttpRequest.post("http://10.10.203.129:7004/LisServicesInterConnectHIS.asmx/LabResultQuery")
.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded")
.header(Header.HOST, "10.10.203.129")
.form("paraXML",params)
.execute();