webservice调用
1、了解WebService(文末:webservice的发布调用的源码)
Web Service是一个平台独立的,低耦合的,自包含的、基于可编程的web的应用程序,可使用开放的XML(标准通用标记语言下的一个子集)标准来描述、发布、发现、协调和配置这些应用程序,用于开发分布式的交互操作的应用程序。
lizi
代码解释:
演示的配置:
IDEA |
Java (SpringBoot框架) |
MongoDB |
SoapUI (https://www.soapui.org/downloads/soapui/) |
1、webservice配置
2、WebService发布接口类
2、实现WebService接口类方法(按照自己需求制定相应方法)
3、WebService方法调用测试
测试结果:
1、患者主索引 v_jheis_patient_index
方法名:getPatient
请求格式:
<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:web=”http://webservice.lli.com/”> <soapenv:Header/> <soapenv:Body> <web:getPatient> <!–Optional:–> <param>参数(String)</param> //这里是参数,此参数为患者的住院号 </web:getPatient> </soapenv:Body> </soapenv:Envelope> |
内容响应:
<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/”> <soap:Body> <ns2:getPatientResponse xmlns:ns2=”http://webservice.lli.com/”> <return>患者信息</return> </ns2:getPatientResponse> </soap:Body> </soap:Envelope> |
2、患者评测明细 v_jheis_evaluation_items
方法名:getEvaluation
请求格式:
<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:web=”http://webservice.lli.com/”> <soapenv:Header/> <soapenv:Body> <web:getEvaluation> <!–Optional:–> <id>参数1(String)</id> //此参数未患者的门诊号 <!–Optional:–> <STime>参数2(String)</STime>//此参数为开始时间查询 <!–Optional:–> <ETime>参数3(String)</ETime>//此参数为结束时间查询 </web:getEvaluation> </soapenv:Body> </soapenv:Envelope> |
内容响应:
<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/”> <soap:Body> <ns2:getEvaluationResponse xmlns:ns2=”http://webservice.lli.com/”> <return> <![CDATA[<evaluation> <ETIME>2020-11-03 22:25:00</ETIME> //记录的结束时间 <INP_NO>P12345</INP_NO> //住院号 <PATIENT_ID>0000930055</PATIENT_ID> //查询的患者门诊号 <STIME>2020-11-03 22:25:00</STIME> //记录的开始时间 <VISIT_ID>1</VISIT_ID> //患者住院次数 //以下是参数值 <vitalSigns> <paramCode>wcssy</paramCode> <paramName>无创收缩</paramName> <paramUnit></paramUnit> <pid>5fa150c0fc21d77f20d20a3e</pid> <time>Tue Nov 03 22:25:00 CST 2020</time> <value>105</value> <_class>today.operation.entity.VitalSigns</_class> <_id>5fa1668ffc21d77f20c51b57</_id> </vitalSigns> </evaluation>]]> </return> </ns2:getEvaluationResponse> </soap:Body> </soap:Envelope> |
WebService源码:
https://chenqiwei.lanzoux.com/iuKRQiv2r7a