zoukankan      html  css  js  c++  java
  • cxf ServerFactoryBean 生成基于soap1.2的WebServices

    //获得服务工厂bean
            ServerFactoryBean bean = new ServerFactoryBean();
    
            HTTPTransportFactory httpTransportFactory = new HTTPTransportFactory();
            //绑定服务的发布地址
            bean.setAddress("http://10.0.1.32:5678/hello");
            //指定提供服务的类型
            bean.setServiceClass(HelloService.class);
            //指定提供服务的实例
            bean.setServiceBean(new HelloServiceImpl());
    
            bean.getServiceFactory().getConfigurations().add(new MethodNameSoapActionServiceConfiguration());
    
            SoapBindingConfiguration conf = new SoapBindingConfiguration();
            conf.setVersion(Soap12.getInstance());
            bean.setBindingConfig(conf);
    
            //启动服务-----publish
            bean.setStart(false);
            ServerImpl server= (ServerImpl)bean.create();
            EndpointInfo e1=((ServletDestination)server.getDestination()).getEndpointInfo();
    
            e1.getBinding().getOperations().forEach(e->{
    
            });
    
    
            Bus b1=((ServletDestination)server.getDestination()).getBus();
            Destination destination= httpTransportFactory.getDestination(e1,b1);
            server.setDestination(destination);
            server.start();
    
    
            System.out.println("server ready...");

    重点代码是

     SoapBindingConfiguration conf = new SoapBindingConfiguration();
            conf.setVersion(Soap12.getInstance());
            bean.setBindingConfig(conf);
  • 相关阅读:
    SqQueue(环状队列(顺序表结构))
    LinkQueue(链队列)
    CharMatch(括号匹配)
    LinkStack
    x-boot
    安装npm及cnpm(Windows)
    sourcetree跳过注册的方法
    Mysql 5.7 CentOS 7 安装MHA
    ORA-12519 ORA-12516
    lisp : set 与setq 函数
  • 原文地址:https://www.cnblogs.com/Gyoung/p/5478154.html
Copyright © 2011-2022 走看看