Package org.apache.hello_world_soap_action

Examples of org.apache.hello_world_soap_action.WrappedGreeter


    public void testWrappedSoapActionSpoofing() throws Exception {
        JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
        pf.setServiceClass(WrappedGreeter.class);
        pf.setAddress(add13);
        pf.setBus(bus);
        WrappedGreeter greeter = (WrappedGreeter) pf.create();
       
        assertEquals("sayHi", greeter.sayHiRequestWrapped("test"));
        assertEquals("sayHi2", greeter.sayHiRequest2Wrapped("test"));       
       
        // Now test spoofing attack
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_2"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test the other operation
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_1"
        );
        try {
            greeter.sayHiRequest2Wrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test a SOAP Action that does not exist in the binding
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_UNKNOWN"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
    }
View Full Code Here


        pf.setAddress(add14);
        SoapBindingConfiguration config = new SoapBindingConfiguration();
        config.setVersion(Soap12.getInstance());
        pf.setBindingConfig(config);
        pf.setBus(bus);
        WrappedGreeter greeter = (WrappedGreeter) pf.create();
       
        assertEquals("sayHi", greeter.sayHiRequestWrapped("test"));
        assertEquals("sayHi2", greeter.sayHiRequest2Wrapped("test"));       
       
        // Now test spoofing attack
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_2"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test the other operation
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_1"
        );
        try {
            greeter.sayHiRequest2Wrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test a SOAP Action that does not exist in the binding
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_UNKNOWN"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
    }
View Full Code Here

    public void testRPCLitSoapActionSpoofing() throws Exception {
        JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
        pf.setServiceClass(WrappedGreeter.class);
        pf.setAddress(add15);
        pf.setBus(bus);
        WrappedGreeter greeter = (WrappedGreeter) pf.create();
       
        assertEquals("sayHi", greeter.sayHiRequestWrapped("test"));
        assertEquals("sayHi2", greeter.sayHiRequest2Wrapped("test"));       
       
        // Now test spoofing attack
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_2"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test the other operation
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_1"
        );
        try {
            greeter.sayHiRequest2Wrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test a SOAP Action that does not exist in the binding
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_UNKNOWN"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
    }
View Full Code Here

    public void testRPCEncodedSoapActionSpoofing() throws Exception {
        JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
        pf.setServiceClass(WrappedGreeter.class);
        pf.setAddress(add16);
        pf.setBus(bus);
        WrappedGreeter greeter = (WrappedGreeter) pf.create();
       
        assertEquals("sayHi", greeter.sayHiRequestWrapped("test"));
        assertEquals("sayHi2", greeter.sayHiRequest2Wrapped("test"));       
       
        // Now test spoofing attack
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_2"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test the other operation
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_1"
        );
        try {
            greeter.sayHiRequest2Wrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test a SOAP Action that does not exist in the binding
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_UNKNOWN"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
    }
View Full Code Here

    public void testWrappedEncodedSoapActionSpoofing() throws Exception {
        JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
        pf.setServiceClass(WrappedGreeter.class);
        pf.setAddress(add17);
        pf.setBus(bus);
        WrappedGreeter greeter = (WrappedGreeter) pf.create();
       
        assertEquals("sayHi", greeter.sayHiRequestWrapped("test"));
        assertEquals("sayHi2", greeter.sayHiRequest2Wrapped("test"));       
       
        // Now test spoofing attack
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_2"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test the other operation
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_1"
        );
        try {
            greeter.sayHiRequest2Wrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
       
        // Test a SOAP Action that does not exist in the binding
        ((BindingProvider)greeter).getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, "true");
        ((BindingProvider)greeter).getRequestContext().put(
            BindingProvider.SOAPACTION_URI_PROPERTY, "SAY_HI_UNKNOWN"
        );
        try {
            greeter.sayHiRequestWrapped("test");
            fail("Failure expected on spoofing attack");
        } catch (Exception ex) {
            // expected
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.hello_world_soap_action.WrappedGreeter

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.