Package org.geotools.data.wps.response

Examples of org.geotools.data.wps.response.ExecuteProcessResponse


        final HTTPResponse httpResponse;

        httpResponse = httpClient.get(statusURL);

        // a request with status can never use raw requests
        return new ExecuteProcessResponse(httpResponse, false);
    }
View Full Code Here


        exeRequest.addInput(identifier, list);
      }
    }
   
    // send the request and get the response
    ExecuteProcessResponse response;
    try {
      response = wps.issueRequest(exeRequest);
    } catch (ServiceException e) {
      return null;
    } catch (IOException e) {
      return null;
    }
   
    // if there is an exception in the response, return null
    // TODO:  properly handle the exception?
    if (response.getExceptionResponse() != null || response.getExecuteResponse() == null) {
      return null;
    }
   
    // get response object and create a map of outputs from it
    ExecuteResponseType executeResponse = response.getExecuteResponse();
   
    // create the result map of outputs
    Map<String, Object> results = new TreeMap<String, Object>();
    results = WPSUtils.createResultMap(executeResponse, results);
   
View Full Code Here

            setProperty(VERSION, "1.0.0");
        }

        public Response createResponse(HTTPResponse httpResponse) throws ServiceException, IOException
        {
            return new ExecuteProcessResponse(httpResponse, responseForm != null && responseForm.getRawDataOutput() != null);
        }
View Full Code Here

        // set input data
        setLocalInputDataBufferPoly(exeRequest, processDesc, geom1);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);

        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNotNull(executeResponse);

        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

        // check that the result is expected
        Geometry expected = geom1.buffer(350);
        EList outputs = executeResponse.getProcessOutputs().getOutput();
View Full Code Here

        // set input data
        set52NInputData(exeRequest, processDesc);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);
        assertNotNull(response.getExecuteResponse());

        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

    }
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        exeRequest.performPostOutput(bos);
        System.out.println(bos.toString());

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);
        assertNotNull(response.getExecuteResponse());

        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

    }
View Full Code Here

        exeRequest.setIdentifier(processIdenLocal);

        setLocalInputDataAdd(exeRequest, processDesc);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);

        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNotNull(executeResponse);

        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

        // check result correctness
        EList outputs = executeResponse.getProcessOutputs().getOutput();
        assertTrue(!outputs.isEmpty());
View Full Code Here

        rawOutput.setMimeType("application/arcgrid");
        ResponseFormType responseForm = wps.createResponseForm(null, rawOutput);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);

        // we should get a raw response, no exception, no response document
        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNull(executeResponse);
        ExceptionReportType exceptionResponse = response.getExceptionResponse();
        assertNull(exceptionResponse);

        // check result correctness
        assertEquals("application/arcgrid", response.getRawContentType());
        BufferedReader reader = new BufferedReader(new InputStreamReader(response.getRawResponseStream()));
        StringBuilder sb = new StringBuilder();
        String line = null;
        while((line = reader.readLine()) != null) {
            sb.append(line).append("\n");
        }
View Full Code Here

        rawOutput.setMimeType("application/arcgrid");
        ResponseFormType responseForm = wps.createResponseForm(null, rawOutput);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);

        // we should get a raw response, no exception, no response document
        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNotNull(executeResponse);
        assertNotNull(executeResponse.getStatus().getProcessFailed());
        assertNotNull( executeResponse.getStatus().getProcessFailed().getExceptionReport());
    }
View Full Code Here

        odt.setAsReference(true);
        ResponseFormType responseForm = wps.createResponseForm(doc, null);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
        assertNotNull(response);

        // we should get a raw response, no exception, no response document
        ExecuteResponseType executeResponse = response.getExecuteResponse();
        assertNotNull(executeResponse);

        // loop and wait for the process to be complete
        while(executeResponse.getStatus().getProcessFailed() == null
                && executeResponse.getStatus().getProcessSucceeded() == null) {
           
            String location = executeResponse.getStatusLocation();
            URL url = new URL(location);
            response = wps.issueStatusRequest(url);
           
            executeResponse = response.getExecuteResponse();
            assertNotNull(executeResponse);
        }

        // check result correctness
        assertEquals(1, executeResponse.getProcessOutputs().getOutput().size());
View Full Code Here

TOP

Related Classes of org.geotools.data.wps.response.ExecuteProcessResponse

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.