Package javax.ws.rs.client

Examples of javax.ws.rs.client.Client


    @Override
    protected Object enrichByType(Class<?> clazz, Method method, ArquillianResteasyResource annotation, Consumes consumes, Produces produces)
    {
        Object value;
        Client client = JerseyClientBuilder.newClient();
        WebTarget webTarget = client.target(getBaseURL() + annotation.value());
        final Map<String, String> headers = getHeaders(clazz, method);
        if (!headers.isEmpty()) {
            webTarget.register(new HeaderFilter(headers));
        }
        JerseyWebTarget jerseyWebTarget = (JerseyWebTarget) webTarget;
View Full Code Here


//  PasswordValidationCallback pwdCallback =
//      new PasswordValidationCallback(clientSubject, username, pwd);

        // Make REST Request

        Client client2 = ClientFactory.newClient();
        RestUtil.initialize(client2);
        WebTarget target = client2.target(restURL);
        target.register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
View Full Code Here

//  PasswordValidationCallback pwdCallback =
//      new PasswordValidationCallback(clientSubject, username, pwd);

        // Make REST Request

        Client client2 = RestUtil.initialize(ClientBuilder.newBuilder()).build();
        WebTarget target = client2.target(restURL);
        target.register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
View Full Code Here

//  PasswordValidationCallback pwdCallback =
//      new PasswordValidationCallback(clientSubject, username, pwd);

        // Make REST Request

        Client client2 = ClientFactory.newClient();
        RestUtil.initialize(client2);
        WebTarget target = client2.target(restURL);
        target.configuration().register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
View Full Code Here

        this.managedClients = new ConcurrentHashMap<BindingModel, Value<ManagedClient>>();
        // init default client
        this.managedClients.put(BindingModel.EMPTY, Values.lazy(new Value<ManagedClient>() {
            @Override
            public ManagedClient get() {
                final Client client;
                if (serverConfig == null) {
                    client = ClientBuilder.newClient();
                } else {
                    ClientConfig clientConfig = new ClientConfig();
                    copyProviders(serverConfig, clientConfig);
View Full Code Here

     * @return {@code true} is the authentication was successful ({@code true} if 401 response code was not returned;
     * {@code false} otherwise).
     *
     */
    static boolean repeatRequest(ClientRequestContext request, ClientResponseContext response, String newAuthorizationHeader) {
        Client client = ClientBuilder.newClient(request.getConfiguration());
        String method = request.getMethod();
        MediaType mediaType = request.getMediaType();
        URI lUri = request.getUri();

        WebTarget resourceTarget = client.target(lUri);

        Invocation.Builder builder = resourceTarget.request(mediaType);


        MultivaluedMap<String, Object> newHeaders = new MultivaluedHashMap<String, Object>();
View Full Code Here

    public void beforeClass() {
        //configure the service
        spreedlyTransactionService.setEnvironmentKey("KPAdXK2qCu0NClgNmvfT45Q0jIu");
        spreedlyTransactionService.setAccessSecret("W3NcbvqpLFNv3ZV9m3Cbj9id4ygkRmQtjFc9J22tsYhnzxkKqjuEqINXBnAijpud");
       
        final Client client = ClientBuilder.newClient()
                .register(new LoggingInterceptor());
       
        spreedlyTransactionService.setClient(client);
    }
View Full Code Here

    public void beforeClass() {
        //configure the service
        spreedlyPaymentMethodService.setEnvironmentKey("KPAdXK2qCu0NClgNmvfT45Q0jIu");
        spreedlyPaymentMethodService.setAccessSecret("W3NcbvqpLFNv3ZV9m3Cbj9id4ygkRmQtjFc9J22tsYhnzxkKqjuEqINXBnAijpud");
       
        final Client client = ClientBuilder.newClient()
                .register(new LoggingInterceptor());
       
        spreedlyPaymentMethodService.setClient(client);
    }
View Full Code Here

    public void beforeClass() {
        //configure the service
        spreedlyGatewayService.setEnvironmentKey("KPAdXK2qCu0NClgNmvfT45Q0jIu");
        spreedlyGatewayService.setAccessSecret("W3NcbvqpLFNv3ZV9m3Cbj9id4ygkRmQtjFc9J22tsYhnzxkKqjuEqINXBnAijpud");
       
        final Client client = ClientBuilder.newClient()
                .register(new LoggingInterceptor());
       
        spreedlyGatewayService.setClient(client);
    }
View Full Code Here

//  PasswordValidationCallback pwdCallback =
//      new PasswordValidationCallback(clientSubject, username, pwd);

        // Make REST Request

        Client client2 = ClientBuilder.newClient();
        RestUtil.initialize(client2);
        WebTarget target = client2.target(restURL);
        target.register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
View Full Code Here

TOP

Related Classes of javax.ws.rs.client.Client

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.