Package org.apache.cxf.ws.policy

Examples of org.apache.cxf.ws.policy.WSPolicyFeature


        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new EchoService());
        sf.setBus(getBus());
        sf.setAddress(address);
       
        WSPolicyFeature policyFeature = new WSPolicyFeature();
        List<Element> policyElements = new ArrayList<Element>();
        if (mtomRequired) {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy.xml"))
                           .getDocumentElement());
        } else {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy-optional.xml"))
                           .getDocumentElement());
            getBus().getExtension(PolicyConstants.class)
               .setNamespace(PolicyConstants.NAMESPACE_W3_200607);
        }
        policyFeature.setPolicyElements(policyElements);      
       
        sf.getFeatures().add(policyFeature);
       
        sf.create();
    }
View Full Code Here


       
        Policy p = new Policy();
        p.setId("test");
       
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.getFeatures().add(new WSPolicyFeature(p));
        sf.setServiceBean(new GreeterImpl());
        sf.setAddress("http://localhost/test");
        sf.setStart(false);
        sf.setBus(bus);
        Server server = sf.create();
View Full Code Here

       
        Policy p = new Policy();
        p.setId("test");
       
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.getFeatures().add(new WSPolicyFeature(p));
        sf.setServiceBean(new GreeterImpl());
        sf.setAddress("http://localhost/test");
        sf.setStart(false);
        sf.setBus(bus);
        Server server = sf.create();
View Full Code Here

        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new EchoService());
        sf.setBus(getBus());
        sf.setAddress(address);
       
        WSPolicyFeature policyFeature = new WSPolicyFeature();
        List<Element> policyElements = new ArrayList<Element>();
        if (mtomRequired) {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy.xml"))
                           .getDocumentElement());
        } else {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy-optional.xml"))
                           .getDocumentElement());
            getBus().getExtension(PolicyConstants.class)
               .setNamespace(PolicyConstants.NAMESPACE_W3_200607);
        }
        policyFeature.setPolicyElements(policyElements);      
       
        sf.getFeatures().add(policyFeature);
       
        sf.create();
    }
View Full Code Here

        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new EchoService());
        sf.setBus(getBus());
        sf.setAddress(address);
       
        WSPolicyFeature policy = new WSPolicyFeature();
        if (mtomRequired) {
            policy.getPolicyElements().add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy.xml"))
                           .getDocumentElement());
        } else {
            policy.getPolicyElements().add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy-optional.xml"))
                           .getDocumentElement());
        }       
       
        sf.getFeatures().add(policy);
View Full Code Here

       
        Policy p = new Policy();
        p.setId("test");
       
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.getFeatures().add(new WSPolicyFeature(p));
        sf.setServiceBean(new GreeterImpl());
        sf.setAddress("http://localhost/test");
        sf.setStart(false);
        sf.setBus(bus);
        Server server = sf.create();
View Full Code Here

        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new EchoService());
        sf.setBus(getStaticBus());
        sf.setAddress(address);
       
        WSPolicyFeature policyFeature = new WSPolicyFeature();
        List<Element> policyElements = new ArrayList<Element>();
        if (mtomRequired) {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy.xml"))
                           .getDocumentElement());
        } else {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy-optional.xml"))
                           .getDocumentElement());
        }
        policyFeature.setPolicyElements(policyElements);      
       
        sf.getFeatures().add(policyFeature);
       
        sf.create();
    }
View Full Code Here

        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new EchoService());
        sf.setBus(getBus());
        sf.setAddress(address);
       
        WSPolicyFeature policyFeature = new WSPolicyFeature();
        List<Element> policyElements = new ArrayList<Element>();
        if (mtomRequired) {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy.xml"))
                           .getDocumentElement());
        } else {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy-optional.xml"))
                           .getDocumentElement());
            getBus().getExtension(PolicyConstants.class)
               .setNamespace(PolicyConstants.NAMESPACE_W3_200607);
        }
        policyFeature.setPolicyElements(policyElements);      
       
        sf.getFeatures().add(policyFeature);
       
        sf.create();
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.ws.policy.WSPolicyFeature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.