zoukankan      html  css  js  c++  java
  • cxf 动态调用.


    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
    import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

    import com.alibaba.fastjson.JSON;
    import com.wistron.swpc.wiproxy.service.model.NodeGateway;
    import com.wistron.swpc.wiproxy.service.util.PropertiesUtil;
    import com.wistron.swpc.wiproxy.service.webservice.DataManager;
    import com.wistron.wh.swpc.homesecurity.webservice.WiHGIWebService;
    import org.apache.cxf.endpoint.Client;

    private static Log log = LogFactory.getLog(DataManagerImpl.class);
     private static JaxWsDynamicClientFactory svr;
     private static Client client;
     private static String url;
     private static WiHGIWebService wws;
     
     static {
      log.debug("init..");
      //url = PropertiesUtil.remoteService;
      svr = JaxWsDynamicClientFactory.newInstance();
            client = svr.createClient("http://192.168.5.105:8080/HomeSecurity/service/HGIService?wsdl");
     }
     

     @Override
     public void commandResult(NodeGateway ng) throws Exception {
      log.debug(url);
      
      //String content = JSON.toJSONString(ng);
      //log.debug(content);
      try {
       client.invoke("getCommandResult", ng.getIp(),ng.getMacStr(),ng.getRecvData(),ng.getRecvCount());
       //log.debug(wws.getCommandResult(content));
      } catch (Exception e) {
       log.error("Remote service can not connect");
       e.printStackTrace();
      }

     }

  • 相关阅读:
    2022 开年计划
    阿里云,华为云产品使用汇总
    git 连接gitlab
    golang 学习汇总
    mongodb分片集群的搭建总结
    2021 年终 总结,随想
    vue请求RSA加密
    sockjsnode/info请求失败
    rules校验
    [转]SPRINGBOOT启动流程及其原理
  • 原文地址:https://www.cnblogs.com/LLLONG/p/3152901.html
Copyright © 2011-2022 走看看