cxf ServerFactory Bean 생 성 soap 1.2 기반 웹 서비스

//      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);

좋은 웹페이지 즐겨찾기