Package org.ofbiz.base.util

Examples of org.ofbiz.base.util.HttpClient.post()


            HttpClient http = new HttpClient("http://ofbiz.apache.org/cgi-bin/http_test.pl");

            http.setHeader("Cookie", "name=value,value=name");
            http.setHeader("User-Agent", "Mozilla/4.0");
            http.setParameter("testId", "testing");
            Debug.logInfo(http.post(), module);
        } catch (Exception e) {
            Debug.logInfo(e, "HttpClientException Caught.", module);
        }
        return "success";
    }
View Full Code Here


        HttpClient httpClient = new HttpClient(url, bodyUrlParameters);
        String body = null;

        try {
            body = httpClient.post();
        } catch (HttpClientException e) {
            Debug.logWarning(e, module);
            return ServiceUtil.returnError("Error getting content: " + e.toString());
        }
View Full Code Here

        HttpClient httpClient = new HttpClient(url, bodyUrlParameters);
        String body = null;

        try {
            body = httpClient.post();
        } catch (HttpClientException e) {
            Debug.logWarning(e, module);
            return ServiceUtil.returnError("Error getting content: " + e.toString());
        }
View Full Code Here

        HttpClient client = new HttpClient(url, request);
        client.setTimeout(timeout * 1000);
        client.setDebug(debug);

        client.setClientCertificateAlias((String) props.get("payment.valuelink.certificateAlias"));
        String response = client.post();

        // parse the response and return a map
        return this.parseResponse(response);
    }

View Full Code Here

        }
        try {
            HttpClient httpClient = new HttpClient(url, request);
            String certificateAlias = props.getProperty("certificateAlias");
            httpClient.setClientCertificateAlias(certificateAlias);
            String httpResponse = httpClient.post();
            Debug.logInfo("transaction response: " + httpResponse,module);
            AuthorizeResponse ar = new AuthorizeResponse(httpResponse);
            String resp = ar.getResponseCode();
            if (resp.equals(AuthorizeResponse.APPROVED)) {
                result.put("authResult", Boolean.TRUE);
View Full Code Here

            */

            LinkedHashMap docMap = new LinkedHashMap();
            String resp = null;
            try {
                resp = http.post(stream);
            } catch (HttpClientException e) {
                Debug.logError(e, module);
                throw new IOException(e.getMessage());
            }

View Full Code Here

        HttpClient http = new HttpClient(serverURL);
        http.setParameter("CLRCMRC_XML", xmlString);

        String response = null;
        try {
            response = http.post();
        } catch (HttpClientException hce) {
            Debug.log(hce, module);
            throw new ClearCommerceException("ClearCommerce connection problem", hce);
        }
View Full Code Here

            }
            http.setContentType("text/xml");
            http.setKeepAlive(true);

            try {
                http.post(outText);
            } catch (Exception e) {
                String errMsg = "Error posting message to server with URL [" + sendToUrl + "]: " + e.toString();
                Debug.logError(e, errMsg, module);
                return ServiceUtil.returnError(errMsg);
            }
View Full Code Here

            HttpClient http = new HttpClient("http://ofbiz.apache.org/cgi-bin/http_test.pl");

            http.setHeader("Cookie", "name=value,value=name");
            http.setHeader("User-Agent", "Mozilla/4.0");
            http.setParameter("testId", "testing");
            Debug.log(http.post(), module);
        } catch (Exception e) {
            Debug.log(e, "HttpClientException Caught.", module);
        }
        return "success";
    }
View Full Code Here

            parameters.put("serviceContext", xmlContext);

        HttpClient http = new HttpClient(this.getLocation(modelService), parameters);
        String postResult = null;
        try {
            postResult = http.post();
        } catch (HttpClientException e) {
            throw new GenericServiceException("Problems invoking HTTP request", e);
        }

        Map<String, Object> result = null;
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.