Examples of URIMapper


Examples of org.apache.cxf.binding.http.URIMapper

        addBefore(MessageSenderInterceptor.class.getName());
    }

    public void handleMessage(Message message) throws Fault {
        Endpoint ep = message.getExchange().get(Endpoint.class);
        URIMapper mapper = (URIMapper)ep.getService().get(URIMapper.class.getName());
        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);

        String address = ep.getEndpointInfo().getAddress();
        String location = mapper.getLocation(bop);

        StringBuilder uri = new StringBuilder();
        uri.append(address);

        boolean addressSlash = address.charAt(address.length() - 1) == '/';
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

            xmlOut.addAfter(wrappedOut.getId());
            chain.add(xmlOut);
           

            Endpoint ep = message.getExchange().get(Endpoint.class);
            URIMapper mapper = (URIMapper) ep.getService().get(URIMapper.class.getName());
            BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
           
            String verb = mapper.getVerb(bop);
            message.put(Message.HTTP_REQUEST_METHOD, verb);
            boolean putOrPost = verb.equals(HttpConstants.POST) || verb.equals(HttpConstants.PUT);
           
            if (putOrPost) {
                chain.doIntercept(message);
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

        props.put("contextMatchStrategy", "stem");
        sf.setProperties(props);
       
        ServerImpl svr = (ServerImpl) sf.create();
               
        URIMapper mapper = (URIMapper) svr.getEndpoint().getService().get(URIMapper.class.getName());
        assertNotNull(mapper);
       
        BindingOperationInfo bop = mapper.getOperation("/customers", "GET", null);
        assertNotNull(bop);
        assertEquals("getCustomers", bop.getName().getLocalPart());
        assertTrue(bop.isUnwrappedCapable());
       
        bop = mapper.getOperation("/customers", "POST", null);
        assertNotNull(bop);
        assertEquals("addCustomer", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers/123", "GET", null);
        assertNotNull(bop);    
        assertEquals("getCustomer", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers/123", "PUT", null);
        assertNotNull(bop);
        assertEquals("updateCustomer", bop.getName().getLocalPart());
       
        // TEST POST/GETs
        Document res = get("http://localhost:9001/customers");
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

        props.put("contextMatchStrategy", "stem");
        sf.setProperties(props);
       
        ServerImpl svr = (ServerImpl) sf.create();

        URIMapper mapper = (URIMapper) svr.getEndpoint().getService().get(URIMapper.class.getName());
        assertNotNull(mapper);
       
        BindingOperationInfo bop = mapper.getOperation("/customers", "GET", null);
        assertNotNull(bop);
        assertEquals("getCustomers", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers", "POST", null);
        assertNotNull(bop);
        assertEquals("addCustomer", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers/123", "GET", null);
        assertNotNull(bop);
        assertEquals("getCustomer", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers/123", "PUT", null);
        assertNotNull(bop);
        assertEquals("updateCustomer", bop.getName().getLocalPart());
       
        // TEST POST/GETs
       
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

        setPhase(Phase.PREPARE_SEND);
    }

    public void handleMessage(Message message) throws Fault {
        Endpoint ep = message.getExchange().get(Endpoint.class);
        URIMapper mapper = (URIMapper)ep.getService().get(URIMapper.class.getName());
        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);

        String address = ep.getEndpointInfo().getAddress();
        String location = mapper.getLocation(bop);

        StringBuilder uri = new StringBuilder();
        uri.append(address);

        boolean addressSlash = address.charAt(address.length() - 1) == '/';
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

            path = path.substring(0, path.length() - 1);
        }
        message.put(RELATIVE_PATH, path);
        LOG.info("Invoking " + method + " on " + path);

        URIMapper mapper = (URIMapper)message.getExchange().get(Service.class).get(URIMapper.class.getName());

        BindingOperationInfo op = mapper.getOperation(path, method, message);

        if (op == null) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OP", BUNDLE, method, path));
        }
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

        LOG.info("URIParameterInterceptor handle message on path [" + path
                 + "] with content-type ["  + contentType + "]");
       
        BindingOperationInfo op = message.getExchange().get(BindingOperationInfo.class);

        URIMapper mapper = (URIMapper)message.getExchange().get(Service.class).get(URIMapper.class.getName());
        String location = mapper.getLocation(op);

        List<MessagePartInfo> parts = op.getOperationInfo().getInput().getMessageParts();

        if (parts.size() == 0) {
            message.setContent(Object.class, Collections.EMPTY_LIST);
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

            xmlOut.addAfter(wrappedOut.getId());
            chain.add(xmlOut);
           

            Endpoint ep = message.getExchange().get(Endpoint.class);
            URIMapper mapper = (URIMapper) ep.getService().get(URIMapper.class.getName());
            BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
           
            String verb = mapper.getVerb(bop);
            message.put(Message.HTTP_REQUEST_METHOD, verb);
            boolean putOrPost = verb.equals(HttpConstants.POST) || verb.equals(HttpConstants.PUT);
           
            if (putOrPost) {
                chain.doIntercept(message);
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

        props.put("contextMatchStrategy", "stem");
        sf.setProperties(props);
       
        ServerImpl svr = (ServerImpl) sf.create();

        URIMapper mapper = (URIMapper) svr.getEndpoint().getService().get(URIMapper.class.getName());
        assertNotNull(mapper);
       
        BindingOperationInfo bop = mapper.getOperation("/customers", "GET", null);
        assertNotNull(bop);
        assertEquals("getCustomers", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers", "POST", null);
        assertNotNull(bop);
        assertEquals("addCustomer", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers/123", "GET", null);
        assertNotNull(bop);
        assertEquals("getCustomer", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers/123", "PUT", null);
        assertNotNull(bop);
        assertEquals("updateCustomer", bop.getName().getLocalPart());
       
        bop = mapper.getOperation("/customers/details/123", "GET", null);
        assertNotNull(bop);
        assertEquals("getSomeDetails", bop.getName().getLocalPart());
       
        // TEST POST/GETs
       
View Full Code Here

Examples of org.apache.cxf.binding.http.URIMapper

        props.put("contextMatchStrategy", "stem");
        sf.setProperties(props);

        ServerImpl svr = (ServerImpl) sf.create();

        URIMapper mapper = (URIMapper) svr.getEndpoint().getService().get(URIMapper.class.getName());
        assertNotNull(mapper);

        BindingOperationInfo bop = mapper.getOperation("/customers", "GET", null);
        assertNotNull(bop);
        assertEquals("getCustomers", bop.getName().getLocalPart());

        bop = mapper.getOperation("/customers", "POST", null);
        assertNotNull(bop);
        assertEquals("addCustomer", bop.getName().getLocalPart());

        bop = mapper.getOperation("/customers/123", "GET", null);
        assertNotNull(bop);
        assertEquals("getCustomer", bop.getName().getLocalPart());

        bop = mapper.getOperation("/customers/123", "PUT", null);
        assertNotNull(bop);
        assertEquals("updateCustomer", bop.getName().getLocalPart());

        bop = mapper.getOperation("/customers/details/123", "GET", null);
        assertNotNull(bop);
        assertEquals("getSomeDetails", bop.getName().getLocalPart());

        // TEST POST/GETs
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.