Package org.apache.cxf.interceptor

Examples of org.apache.cxf.interceptor.URIMappingInterceptor


    public void before() throws Exception {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setAddress("http://localhost:" + PORT + "/Echo");
        sf.setDataBinding(new AegisDatabinding());
        sf.setServiceBean(new Echo());
        sf.getInInterceptors().add(new URIMappingInterceptor());
        Server server = sf.create();
        // turn off nanny in URIMappingInterceptor
        server.getEndpoint()
            .getService().put(AbstractInDatabindingInterceptor.NO_VALIDATE_PARTS, Boolean.TRUE);
       
        ServerFactoryBean sf2 = new ServerFactoryBean();
        sf2.setAddress("http://localhost:" + PORT + "/SimpleEcho");
        sf2.setDataBinding(new AegisDatabinding());
        sf2.setServiceBean(new Echo());
        sf2.getInInterceptors().add(new URIMappingInterceptor());
        server = sf2.create();
        // turn off nanny in URIMappingInterceptor
        server.getEndpoint()
            .getService().put(AbstractInDatabindingInterceptor.NO_VALIDATE_PARTS, Boolean.TRUE);
    }
View Full Code Here


    protected void run()  {   
        Object implementor = new GreeterImpl();
        String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
        ep = Endpoint.publish(address, implementor);
        EndpointImpl epi = (EndpointImpl)ep;
        epi.getService().getInInterceptors().add(new URIMappingInterceptor());
       
        implementor = new org.apache.hello_world_soap_http.GreeterImpl();
        address = "http://localhost:" + PORT + "/SoapContext/Soap11Port";
        ep11 = Endpoint.publish(address, implementor);
    }
View Full Code Here

        Endpoint ep = Endpoint.create(implementor);
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(WSDLGetUtils.WSDL_CREATE_IMPORTS, Boolean.TRUE);
        ep.setProperties(props);
        ep.publish(address);
        ((EndpointImpl)ep).getService().getInInterceptors().add(new URIMappingInterceptor());
    }
View Full Code Here

        eps.add(Endpoint.publish(address, implementor));
       
        implementor = new GreeterImpl();
        address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
        Endpoint ep = Endpoint.publish(address, implementor);
        ((EndpointImpl)ep).getService().getInInterceptors().add(new URIMappingInterceptor());
        eps.add(ep);
       
        implementor = new GreeterImpl();
        address = "http://localhost:" + PORT + "/SoapContext/SoapPortWithGzip";
        Endpoint ep2 = Endpoint.publish(address, implementor);
View Full Code Here

   
    @Test
    public void testGetSayHiFromPath() throws Exception {
        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/sayHi");      
       
        URIMappingInterceptor interceptor = new URIMappingInterceptor();
        interceptor.handleMessage(message);
       
        assertNull(message.getContent(Exception.class));
       
        Object parameters = message.getContent(List.class);
        assertNotNull(parameters);
View Full Code Here

   
    @Test
    public void testGetGreetMeFromPath() throws Exception {
        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe/in/king+author");
       
        URIMappingInterceptor interceptor = new URIMappingInterceptor();       
        interceptor.handleMessage(message);
       
        assertNull(message.getContent(Exception.class));
       
        Object parameters = message.getContent(List.class);
        assertNotNull(parameters);
View Full Code Here

    public void testGetSayHiFromQueryFixedOrder() throws Exception {
        message.put(Message.FIXED_PARAMETER_ORDER, Boolean.TRUE);
        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
        message.put(Message.QUERY_STRING, "me=king");
       
        URIMappingInterceptor interceptor = new URIMappingInterceptor();
        interceptor.handleMessage(message);
       
        assertNull(message.getContent(Exception.class));
       
        assertion();
    }
View Full Code Here

    @Test
    public void testGetSayHiFromQueryRandomOrder() throws Exception {
        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
        message.put(Message.QUERY_STRING, "in=king");
       
        URIMappingInterceptor interceptor = new URIMappingInterceptor();
        interceptor.handleMessage(message);
       
        assertNull(message.getContent(Exception.class));       
        assertion();
    }
View Full Code Here

    @Test
    public void testGetSayHiFromQueryRandomOrderFault() throws Exception {
        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
        message.put(Message.QUERY_STRING, "me=king");
       
        URIMappingInterceptor interceptor = new URIMappingInterceptor();
        try {
            interceptor.handleMessage(message);
        } catch (Exception e) {
            assertTrue(e instanceof Fault);
            assertEquals("Parameter should be ordered in the following sequence: [in]", e.getMessage());
        }
        Object parameters = message.getContent(List.class);
View Full Code Here

    @Test
    public void testGetSayHiFromQueryEncoded() throws Exception {
        message.put(Message.PATH_INFO, "/SOAPServiceRPCLit/SoapPort/greetMe");
        message.put(Message.QUERY_STRING, "in=king+author");
       
        URIMappingInterceptor interceptor = new URIMappingInterceptor();
        interceptor.handleMessage(message);
       
        assertNull(message.getContent(Exception.class));
       
        Object parameters = message.getContent(List.class);
        assertNotNull(parameters);
View Full Code Here

TOP

Related Classes of org.apache.cxf.interceptor.URIMappingInterceptor

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.