|
|
|
@ -2,16 +2,9 @@ package com.emr.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.emr.util.PropertiesUtils;
|
|
|
|
import com.emr.util.PropertiesUtils;
|
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.PropertySources;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletContextEvent;
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
import javax.servlet.ServletContextListener;
|
|
|
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @ProjectName:预加载一次webService
|
|
|
|
* @ProjectName:预加载一次webService
|
|
|
|
@ -26,20 +19,22 @@ import java.util.Properties;
|
|
|
|
* @Version: 1.0
|
|
|
|
* @Version: 1.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Component
|
|
|
|
@Component
|
|
|
|
public class WebServiceLoad implements ServletContextListener {
|
|
|
|
public class WebServiceLoad {
|
|
|
|
@Override
|
|
|
|
@PostConstruct
|
|
|
|
public void contextInitialized(ServletContextEvent sce){
|
|
|
|
public void contextInitialized() {
|
|
|
|
try {
|
|
|
|
new Thread(() -> {
|
|
|
|
String token = "11";
|
|
|
|
String token = "11";
|
|
|
|
String POWER_URLHEAD = PropertiesUtils.getProperty("POWER_JSP");
|
|
|
|
String POWER_URLHEAD = PropertiesUtils.getProperty("POWER_JSP");
|
|
|
|
//创建连接工厂
|
|
|
|
//创建连接工厂
|
|
|
|
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
|
|
|
|
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
|
|
|
|
//创建客户端
|
|
|
|
//创建客户端
|
|
|
|
Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl");
|
|
|
|
Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl");
|
|
|
|
|
|
|
|
try {
|
|
|
|
//动态调用getInfosByUserId方法
|
|
|
|
//动态调用getInfosByUserId方法
|
|
|
|
Object[] objects = client.invoke("getInfosByUserId", token, "emr_record");
|
|
|
|
Object[] objects = client.invoke("getInfosByUserId", token, "emr_record");
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}).start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|