Package org.apache.cxf.jaxrs.client

Examples of org.apache.cxf.jaxrs.client.WebClient.back()


        WebClient client = createClient(url);

        checkAutherization(client, username, password);

        client.back(true);// Go to baseURI
        client.path(path);
        if (!query.isEmpty()) {
            client.query("jql", query);
        }
        client.query("maxResults", MAX_RESULTS);
View Full Code Here


        WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1);
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = wc.get(Book.class);
        assertEquals(123, b.getId());
       
        wc.back(true);
       
        BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
        Book b2 = bs.getSecureBook("123");
        assertEquals(b2.getId(), 123);
       
View Full Code Here

        WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1);
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = wc.get(Book.class);
        assertEquals(123, b.getId());
       
        wc.back(true);
       
        BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
        Book b2 = bs.getSecureBook("123");
        assertEquals(b2.getId(), 123);
       
View Full Code Here

        WebClient wc = WebClient.create("https://localhost:9095", CLIENT_CONFIG_FILE);
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = wc.get(Book.class);
        assertEquals(123, b.getId());
       
        wc.back(true);
       
        BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
        Book b2 = bs.getSecureBook("123");
        assertEquals(b2.getId(), 123);
       
View Full Code Here

        WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1);
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = wc.get(Book.class);
        assertEquals(123, b.getId());
       
        wc.back(true);
       
        BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
        Book b2 = bs.getSecureBook("123");
        assertEquals(b2.getId(), 123);
       
View Full Code Here

        WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1);
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = wc.get(Book.class);
        assertEquals(123, b.getId());
       
        wc.back(true);
       
        BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
        Book b2 = bs.getSecureBook("123");
        assertEquals(b2.getId(), 123);
       
View Full Code Here

    @Test
    public void testRootElementWithHeader() {
        WebClient wc = WebClient.create(Main.BASE_URI);
        String e1 = wc.path("jaxb/XmlRootElement").get(String.class);

        String e2 = wc.back(false).path("XmlRootElementWithHeader").get(String.class);

        assertTrue(e2
                .contains("<?xml-stylesheet type='text/xsl' href='http://localhost:9998/foobar.xsl'?>")
                && e2.contains(e1.substring(e1.indexOf("?>") + 2).trim()));
    }
View Full Code Here

        JAXBXmlType t1 = wc.path("jaxb/JAXBElement").get(JAXBXmlType.class);

        JAXBElement<JAXBXmlType> e = new JAXBElement<JAXBXmlType>(new QName("jaxbXmlRootElement"),
                JAXBXmlType.class, t1);

        JAXBXmlType t2 = wc.back(false).path("XmlType").type("application/xml")
                .post(e, JAXBXmlType.class);

        assertEquals(t1, t2);
    }
View Full Code Here

         * JAXBXmlRootElement and JAXBXmlType.  CXF does not
         * plan to offer this support.
         */
       
        // fail in CXF, post() requires JAXBXmlRootElement[].class
        JAXBXmlType[] at1 = wc.back(false).path("XmlType").
                type("application/xml").
                post(ae1, JAXBXmlType[].class);

        // fail in CXF, get() returns JAXBXmlRootElement[]
        JAXBXmlType[] at2 = wc.back(false).path("XmlRootElement").
View Full Code Here

        JAXBXmlType[] at1 = wc.back(false).path("XmlType").
                type("application/xml").
                post(ae1, JAXBXmlType[].class);

        // fail in CXF, get() returns JAXBXmlRootElement[]
        JAXBXmlType[] at2 = wc.back(false).path("XmlRootElement").
                get(JAXBXmlType[].class);

        assertEquals(at1.length, at2.length);
        for (int i = 0; i < at1.length; i++)
            assertEquals(at1[i], at2[i]);
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.