Package org.apache.schema_validation

Examples of org.apache.schema_validation.SchemaValidationService


    @Test
    public void testSchemaValidation() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);
        updateAddressPort(validation, PORT);
        ((BindingProvider)validation).getRequestContext()
            .put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.TRUE);

        ComplexStruct complexStruct = new ComplexStruct();
View Full Code Here


    @Test
    public void testHeaderValidation() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);
        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

       
        String smsg = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Header>"
            + "<SomeHeader soap:mustUnderstand='1' xmlns='http://apache.org/schema_validation/types'>"
            + "<id>1111111111</id></SomeHeader>"
            + "</soap:Header><soap:Body><SomeRequestWithHeader xmlns='http://apache.org/schema_validation/types'>"
            + "<id>1111111111</id></SomeRequestWithHeader></soap:Body></soap:Envelope>";
        Dispatch<Source> dsp = service.createDispatch(SchemaValidationService.SoapPort, Source.class, Mode.MESSAGE);
        updateAddressPort(dsp, PORT);
        dsp.invoke(new StreamSource(new StringReader(smsg)));
    }
View Full Code Here

    }
    private SchemaValidation createService(Object validationConfig, String postfix) throws Exception {
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);
        setAddress(validation, "http://localhost:" + PORT + "/SoapContext/" + postfix);
       
        ((BindingProvider)validation).getRequestContext().put(Message.SCHEMA_VALIDATION_ENABLED, validationConfig);
        ((BindingProvider)validation).getResponseContext().put(Message.SCHEMA_VALIDATION_ENABLED, validationConfig);
        new LoggingFeature().initialize(ClientProxy.getClient(validation), getBus());
View Full Code Here

    public void testSchemaValidation() throws Exception {
        System.setProperty("cxf.config.file.url", getClass().getResource("cxf-config.xml").toString());
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);

        ComplexStruct complexStruct = new ComplexStruct();
        complexStruct.setElem1("one");
        // Don't initialize a member of the structure. 
        // Client side validation should throw an exception.
View Full Code Here

    public void testSchemaValidation() throws Exception {
        System.setProperty("cxf.config.file.url", getClass().getResource("cxf-config.xml").toString());
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);

        ComplexStruct complexStruct = new ComplexStruct();
        complexStruct.setElem1("one");
        // Don't initialize a member of the structure. 
        // Client side validation should throw an exception.
View Full Code Here

    public void testSchemaValidation() throws Exception {
        System.setProperty("cxf.config.file.url", getClass().getResource("cxf-config.xml").toString());
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);

        ComplexStruct complexStruct = new ComplexStruct();
        complexStruct.setElem1("one");
        // Don't initialize a member of the structure. 
        // Client side validation should throw an exception.
View Full Code Here

   
    private SchemaValidation createService(Object validationConfig) throws Exception {
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);
        updateAddressPort(validation, PORT);
        ((BindingProvider)validation).getRequestContext().put(Message.SCHEMA_VALIDATION_ENABLED, validationConfig);
        ((BindingProvider)validation).getResponseContext().put(Message.SCHEMA_VALIDATION_ENABLED, validationConfig);
       
        return validation;
View Full Code Here

    public void testSchemaValidation() throws Exception {
        System.setProperty("cxf.config.file.url", getClass().getResource("cxf-config.xml").toString());
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);

        updateAddressPort(validation, PORT);

        ComplexStruct complexStruct = new ComplexStruct();
        complexStruct.setElem1("one");
View Full Code Here

    @Test
    public void testHeaderValidation() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);
        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

       
        String smsg = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Header>"
            + "<SomeHeader soap:mustUnderstand='1' xmlns='http://apache.org/schema_validation/types'>"
            + "<id>1111111111</id></SomeHeader>"
            + "</soap:Header><soap:Body><SomeRequestWithHeader xmlns='http://apache.org/schema_validation/types'>"
            + "<id>1111111111</id></SomeRequestWithHeader></soap:Body></soap:Envelope>";
        Dispatch<Source> dsp = service.createDispatch(SchemaValidationService.SoapPort, Source.class, Mode.MESSAGE);
        updateAddressPort(dsp, PORT);
        dsp.invoke(new StreamSource(new StringReader(smsg)));
    }
View Full Code Here

    }
    private SchemaValidation createService(Object validationConfig, String postfix) throws Exception {
        URL wsdl = getClass().getResource("/wsdl/schema_validation.wsdl");
        assertNotNull(wsdl);

        SchemaValidationService service = new SchemaValidationService(wsdl, serviceName);
        assertNotNull(service);

        SchemaValidation validation = service.getPort(portName, SchemaValidation.class);
        setAddress(validation, "http://localhost:" + PORT + "/SoapContext/" + postfix);
       
        ((BindingProvider)validation).getRequestContext().put(Message.SCHEMA_VALIDATION_ENABLED, validationConfig);
        ((BindingProvider)validation).getResponseContext().put(Message.SCHEMA_VALIDATION_ENABLED, validationConfig);
        new LoggingFeature().initialize((Client)validation, getBus());
View Full Code Here

TOP

Related Classes of org.apache.schema_validation.SchemaValidationService

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.