Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.InputStreamRequestEntity


                        String str = ValueFormat.getJCRString(value, resolver);
                        ent = new StringRequestEntity(str, contentType, "UTF-8");
                        break;
                    case PropertyType.BINARY:
                        in = value.getStream();
                        ent = new InputStreamRequestEntity(in, contentType);
                        break;
                    default:
                        str = value.getString();
                        ent = new StringRequestEntity(str, contentType, "UTF-8");
                        break;
View Full Code Here


                        String str = ValueFormat.getJCRString(value, resolver);
                        ent = new StringRequestEntity(str, contentType, "UTF-8");
                        break;
                    case PropertyType.BINARY:
                        in = value.getStream();
                        ent = new InputStreamRequestEntity(in, contentType);
                        break;
                    default:
                        str = value.getString();
                        ent = new StringRequestEntity(str, contentType, "UTF-8");
                        break;
View Full Code Here

        // TODO: improve. currently random name is built instead of retrieving name of new resource from top-level xml element within stream
        Name nodeName = getNameFactory().create(Name.NS_DEFAULT_URI, UUID.randomUUID().toString());
        String uri = getItemUri(parentId, nodeName, sessionInfo);
        MkColMethod method = new MkColMethod(uri);
        method.addRequestHeader(JcrRemotingConstants.IMPORT_UUID_BEHAVIOR, Integer.toString(uuidBehaviour));
        method.setRequestEntity(new InputStreamRequestEntity(xmlStream, "text/xml"));
        execute(method, sessionInfo);
    }
View Full Code Here

        PostMethod postMethod = new PostMethod(url);
        postMethod.addRequestHeader(HttpTransportConstants.HEADER_CONTENT_TYPE, "text/xml");
        postMethod.addRequestHeader(TransportConstants.HEADER_SOAP_ACTION,
                "http://springframework.org/spring-ws/NoResponse");
        Resource soapRequest = new ClassPathResource("soapRequest.xml", WebServiceHttpHandlerIntegrationTest.class);
        postMethod.setRequestEntity(new InputStreamRequestEntity(soapRequest.getInputStream()));
        client.executeMethod(postMethod);
        assertEquals("Invalid Response Code", HttpTransportConstants.STATUS_ACCEPTED, postMethod.getStatusCode());
        assertEquals("Response retrieved", 0, postMethod.getResponseContentLength());
    }
View Full Code Here

        PostMethod postMethod = new PostMethod(url);
        postMethod.addRequestHeader(HttpTransportConstants.HEADER_CONTENT_TYPE, "text/xml");
        postMethod.addRequestHeader(TransportConstants.HEADER_SOAP_ACTION,
                "http://springframework.org/spring-ws/Response");
        Resource soapRequest = new ClassPathResource("soapRequest.xml", WebServiceHttpHandlerIntegrationTest.class);
        postMethod.setRequestEntity(new InputStreamRequestEntity(soapRequest.getInputStream()));
        client.executeMethod(postMethod);
        assertEquals("Invalid Response Code", HttpTransportConstants.STATUS_OK, postMethod.getStatusCode());
        assertTrue("No Response retrieved", postMethod.getResponseContentLength() > 0);
    }
View Full Code Here

        PostMethod postMethod = new PostMethod(url);
        postMethod.addRequestHeader(HttpTransportConstants.HEADER_CONTENT_TYPE, "text/xml");
        postMethod.addRequestHeader(TransportConstants.HEADER_SOAP_ACTION,
                "http://springframework.org/spring-ws/NoEndpoint");
        Resource soapRequest = new ClassPathResource("soapRequest.xml", WebServiceHttpHandlerIntegrationTest.class);
        postMethod.setRequestEntity(new InputStreamRequestEntity(soapRequest.getInputStream()));
        client.executeMethod(postMethod);
        assertEquals("Invalid Response Code", HttpTransportConstants.STATUS_NOT_FOUND, postMethod.getStatusCode());
        assertEquals("Response retrieved", 0, postMethod.getResponseContentLength());
    }
View Full Code Here

        PostMethod postMethod = new PostMethod(url);
        postMethod.addRequestHeader(HttpTransportConstants.HEADER_CONTENT_TYPE, "text/xml");
        postMethod
                .addRequestHeader(TransportConstants.HEADER_SOAP_ACTION, "http://springframework.org/spring-ws/Fault");
        Resource soapRequest = new ClassPathResource("soapRequest.xml", WebServiceHttpHandlerIntegrationTest.class);
        postMethod.setRequestEntity(new InputStreamRequestEntity(soapRequest.getInputStream()));
        client.executeMethod(postMethod);
        assertEquals("Invalid Response Code", HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR,
                postMethod.getStatusCode());
        assertTrue("No Response retrieved", postMethod.getResponseContentLength() > 0);
    }
View Full Code Here

            DiskFileItemFactory diskFileItemFactory)
            throws ServletException {
        // TODO: this function doesn't set any history data
        try {
            // just pass back the binary data
            InputStreamRequestEntity ire = new InputStreamRequestEntity(httpServletRequest.getInputStream());
            postMethodProxyRequest.setRequestEntity(ire);
            postMethodProxyRequest.setRequestHeader(STRING_CONTENT_TYPE_HEADER_NAME, httpServletRequest.getHeader(STRING_CONTENT_TYPE_HEADER_NAME));
        } catch (Exception e) {
            throw new ServletException(e);
        }
View Full Code Here

        finalUrl = target + base;
      } else {
        finalUrl = target + "/" + base;
      }
      PutMethod method = new PutMethod(finalUrl);
          method.setRequestEntity(new InputStreamRequestEntity(
              new FileInputStream(cdx)));

      int statusCode = client.executeMethod(method);
          if (statusCode == HttpStatus.SC_OK) {
            LOGGER.info("Uploaded cdx " + cdx.getAbsolutePath() + " to " +
View Full Code Here

        String ct = type + "; type=\"text/xml\"; " + "start=\"rootPart\"; "
            + "boundary=\"----=_Part_4_701508.1145579811786\"";
        post.setRequestHeader("Content-Type", ct);
        InputStream is =
            getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/" + resourceName);
        RequestEntity entity = new InputStreamRequestEntity(is);
        post.setRequestEntity(entity);
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.methods.InputStreamRequestEntity

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.