Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.PostMethod.addRequestHeader()


    public void testGetPlainLong() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/bookstore/booksplain";

        PostMethod post = new PostMethod(endpointAddress);
        post.addRequestHeader("Content-Type" , "text/plain");
        post.addRequestHeader("Accept" , "text/plain");
        post.setRequestBody("12345");
        HttpClient httpclient = new HttpClient();
       
        try {
View Full Code Here


        String endpointAddress =
            "http://localhost:" + PORT + "/bookstore/booksplain";

        PostMethod post = new PostMethod(endpointAddress);
        post.addRequestHeader("Content-Type" , "text/plain");
        post.addRequestHeader("Accept" , "text/plain");
        post.setRequestBody("12345");
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
View Full Code Here

        copyHeaderInformation(nm, method);
        RequestEntity entity = writeMessage(writer);
        // remove content-type header that may have been part of the in message
        if (!endpoint.isWantContentTypeHeaderFromExchangeIntoHttpRequest()) {
            method.removeRequestHeader(HEADER_CONTENT_TYPE);
            method.addRequestHeader(HEADER_CONTENT_TYPE, entity.getContentType());
        }
        if (entity.getContentLength() < 0) {
            method.removeRequestHeader(HEADER_CONTENT_LENGTH);
        } else {
            method.setRequestHeader(HEADER_CONTENT_LENGTH, Long.toString(entity.getContentLength()));
View Full Code Here

    public void testGetPlainLong() throws Exception {
        String endpointAddress =
            "http://localhost:9080/bookstore/booksplain";

        PostMethod post = new PostMethod(endpointAddress);
        post.addRequestHeader("Content-Type" , "text/plain");
        post.addRequestHeader("Accept" , "text/plain");
        post.setRequestBody("12345");
        HttpClient httpclient = new HttpClient();
       
        try {
View Full Code Here

        String endpointAddress =
            "http://localhost:9080/bookstore/booksplain";

        PostMethod post = new PostMethod(endpointAddress);
        post.addRequestHeader("Content-Type" , "text/plain");
        post.addRequestHeader("Accept" , "text/plain");
        post.setRequestBody("12345");
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
View Full Code Here

    }

    @Test
    public void testNoResponse() throws IOException {
        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);
View Full Code Here

    @Test
    public void testNoResponse() throws IOException {
        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());
View Full Code Here

    }

    @Test
    public void testResponse() throws IOException {
        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);
View Full Code Here

    @Test
    public void testResponse() throws IOException {
        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());
View Full Code Here

    }

    @Test
    public void testNoEndpoint() throws IOException {
        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);
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.