Package org.apache.cxf.jaxrs.client

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


      authorizeClient.reset();
      authorizeClient.to(data.getReplyTo(), false);
      if (authenticityCookie != null) {
        authorizeClient.header("Cookie", (String)authenticityCookie);
      }
      Response r2 = authorizeClient.form(authorizationResult);
     
      int status2 = r2.getStatus();
      Object locationHeader2 = r2.getMetadata().getFirst("Location");
      if (status2 != 303 || locationHeader2 == null) {
        System.out.println("OAuth flow is broken");
View Full Code Here


    }

    public void registerClientApplication() throws Exception {
      WebClient rs = WebClient.create("http://localhost:" + port + "/services/oauth/registerProvider");
      WebClient.getConfig(rs).getHttpConduit().getClient().setReceiveTimeout(10000000L);
      rs.form(new Form().set("appName", "Restaurant Reservations")
                    .set("appURI", "http://localhost:" + port + "/services/reservations/reserve")
                    .set("appRedirectURI", "http://localhost:" + port + "/services/reservations/reserve/complete")
                    );
    }
   
View Full Code Here

    }
   
    public void createUserAccount() throws Exception {
      WebClient rs = WebClient.create("http://localhost:" + port + "/services/register/registerUser");
      WebClient.getConfig(rs).getHttpConduit().getClient().setReceiveTimeout(10000000L);
      rs.form(new Form().set("user", "barry@social.com").set("password", "1234"));
     
      printUserCalendar();
    }
   
    private void printUserCalendar() {
View Full Code Here

   
    private void updateAndGetUserCalendar(int hour, String event) {
      WebClient client = createClient("http://localhost:" + port + "/services/social/accounts/calendar",
          "barry@social.com", "1234");
      Form form = new Form().set("hour", hour).set("event", event);
      client.form(form);
      printUserCalendar();
    }
   
    public void reserveTable() throws Exception {
      WebClient rs = createClient("http://localhost:" + port + "/services/reservations/reserve/table",
View Full Code Here

    }
   
    public void reserveTable() throws Exception {
      WebClient rs = createClient("http://localhost:" + port + "/services/reservations/reserve/table",
          "barry@restaurant.com", "5678");
      Response r = rs.form(new Form().set("name", "Barry")
                                 .set("phone", "12345678")
                                 .set("hour", "7"));
     
      int status = r.getStatus();
      Object locationHeader = r.getMetadata().getFirst("Location");
View Full Code Here

      authorizeClient.reset();
      authorizeClient.to(data.getReplyTo(), false);
      if (authenticityCookie != null) {
        authorizeClient.header("Cookie", (String)authenticityCookie);
      }
      Response r2 = authorizeClient.form(authorizationResult);
     
      int status2 = r2.getStatus();
      Object locationHeader2 = r2.getMetadata().getFirst("Location");
      if (status2 != 303 || locationHeader2 == null) {
        System.out.println("OAuth flow is broken");
View Full Code Here

    @Test
    public void testTooManyFormParams() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth-form";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.form(new Form().set("a", "b"));
        assertEquals(204, r.getStatus());
        r = wc.form(new Form().set("a", "b").set("c", "b"));
        assertEquals(413, r.getStatus());
    }
   
View Full Code Here

        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth-form";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.form(new Form().set("a", "b"));
        assertEquals(204, r.getStatus());
        r = wc.form(new Form().set("a", "b").set("c", "b"));
        assertEquals(413, r.getStatus());
    }
   
   
    @Test
View Full Code Here

    @Test
    public void testTooManyFormParams() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth-form";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.form(new Form().set("a", "b"));
        assertEquals(204, r.getStatus());
        r = wc.form(new Form().set("a", "b").set("c", "b"));
        assertEquals(413, r.getStatus());
    }
   
View Full Code Here

        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth-form";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.form(new Form().set("a", "b"));
        assertEquals(204, r.getStatus());
        r = wc.form(new Form().set("a", "b").set("c", "b"));
        assertEquals(413, r.getStatus());
    }
   
   
    @Test
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.