Package org.geotools.data.ows

Examples of org.geotools.data.ows.HTTPResponse


    private String typeName = "comuni:comuni11";
       
    private WFSDataStore getWFSDataStore(HTTPClient httpClient) throws IOException {
        URL capabilitiesUrl = new URL("http://127.0.0.1:8888/cgi-bin/tinyows?service=WFS&version=1.1.0&REQUEST=GetCapabilities");       
       
        HTTPResponse httpResponse = httpClient.get(capabilitiesUrl);
        InputStream inputStream = httpResponse.getResponseStream();
       
        byte[] wfsCapabilitiesRawData = IOUtils.toByteArray(inputStream);
        InputStream capsIn = new ByteArrayInputStream(wfsCapabilitiesRawData);
        WFS_1_1_0_DataStore wfs = new WFS_1_1_0_DataStore(new WFS_1_1_0_Protocol(capsIn, httpClient, null, null) {
            @Override
View Full Code Here


public class MapServerTest {

    private WFSDataStore getWFSDataStore(HTTPClient httpClient) throws IOException {
        URL capabilitiesUrl = new URL("http://127.0.0.1:8888/mapserver?service=WFS&version=1.1.0&REQUEST=GetCapabilities");       
       
        HTTPResponse httpResponse = httpClient.get(capabilitiesUrl);
        InputStream inputStream = httpResponse.getResponseStream();
       
        byte[] wfsCapabilitiesRawData = IOUtils.toByteArray(inputStream);
        InputStream capsIn = new ByteArrayInputStream(wfsCapabilitiesRawData);
        WFS_1_1_0_DataStore wfs = new WFS_1_1_0_DataStore(new WFS_1_1_0_Protocol(capsIn, httpClient, null, new MapServerStrategy()) {
           
View Full Code Here

    private WFSResponse issueGetRequest(EObject request, URL url, Map<String, String> kvp)
            throws IOException {
        WFSResponse response;
        final URL targetUrl = createUrl(url, kvp);
        HTTPResponse httpResponse = http.get(targetUrl);

        String responseCharset = httpResponse.getResponseCharset();
        Charset charset = responseCharset == null ? null : Charset.forName(responseCharset);
        String contentType = httpResponse.getContentType();
        InputStream responseStream = httpResponse.getResponseStream();
        response = new WFSResponse(targetUrl.toExternalForm(), request, charset, contentType, responseStream);
        return response;
    }
View Full Code Here

            WFS_1_1_0_Protocol.encode(request, encoder, out);
           
            postContent = new ByteArrayInputStream(out.toByteArray());
        }
       
        HTTPResponse httpResponse = http.post(url, postContent, "text/xml");

        String responseCharset = httpResponse.getResponseCharset();
        Charset charset = responseCharset == null ? null : Charset.forName(responseCharset);
        String contentType = httpResponse.getContentType();
        InputStream responseStream = httpResponse.getResponseStream();

        WFSResponse response = new WFSResponse(url.toExternalForm(), request, charset, contentType,
                responseStream);
        return response;
    }
View Full Code Here

            fail("Expected IAE");
        } catch (IllegalArgumentException e) {
            assertTrue(true);
        }

        HTTPResponse httpResponse = new TestHttpResponse("text/xml; subtype=gml/3.1.1", null,
                "mock-content");
        TestHttpProtocol mockHttp = new TestHttpProtocol(httpResponse);

        createTestProtocol(GEOS_ARCHSITES.CAPABILITIES, mockHttp);
View Full Code Here

  private String typeName = "Test_SaintPaul_TestStPaul:Projected_StPaul";
 
  private WFSDataStore getWFSDataStore(HTTPClient httpClient) throws IOException {
        URL capabilitiesUrl = new URL("http://127.0.0.1:8888/cgi-bin/tinyows?service=WFS&version=1.1.0&REQUEST=GetCapabilities");       
       
        HTTPResponse httpResponse = httpClient.get(capabilitiesUrl);
        InputStream inputStream = httpResponse.getResponseStream();
       
        byte[] wfsCapabilitiesRawData = IOUtils.toByteArray(inputStream);
        InputStream capsIn = new ByteArrayInputStream(wfsCapabilitiesRawData);
        WFS_1_1_0_DataStore wfs = new WFS_1_1_0_DataStore(new WFS_1_1_0_Protocol(capsIn, httpClient, null, new ArcGISServerStrategy()) {
            @Override
View Full Code Here

        @Override
        public DescribeFeatureTypeResponse issueRequest(DescribeFeatureTypeRequest request) throws IOException {
            if (describeFeatureTypeUrlOverride == null) {
                return super.issueRequest(request);
            }           
            HTTPResponse response = new TestHttpResponse(request.getOutputFormat(), "UTF-8", describeFeatureTypeUrlOverride);
            try {
                return new DescribeFeatureTypeResponse(request, response);
            } catch (ServiceException e) {
                throw new IOException(e);
            }
View Full Code Here

        client.setReadTimeout(readTimeout);
        try {
            LOGGER.log(
                    Level.FINE,
                    "Issuing request to authkey webservice: " + url);
            HTTPResponse response = client.get(new URL(url));
            BufferedReader reader = null;
            InputStream responseStream = response.getResponseStream();
            StringBuilder result = new StringBuilder();
            try {
                reader = new BufferedReader(new InputStreamReader(responseStream));
                String line = null;
                while ((line = reader.readLine()) != null) {
View Full Code Here

        }

        @Override
        public HTTPResponse get(final URL url) throws IOException {
           
                return new HTTPResponse() {
                   
                    @Override
                    public InputStream getResponseStream() throws IOException {
                        if(url.getPath().substring(1).equals(authkey)) {
                            return new ByteArrayInputStream(new String(response).getBytes());
View Full Code Here

            is.close();
        }
    }

    private HTTPResponse getResponse(Request request) {
        HTTPResponse response = expectedRequests.get(request);
        if (response == null) {
            StringBuilder sb = new StringBuilder("Unexepected request \n" + request + "\nNo response is bound to it. Bound urls are: ");
            for (Request r : expectedRequests.keySet()) {
                sb.append("\n").append(r);
            }
View Full Code Here

TOP

Related Classes of org.geotools.data.ows.HTTPResponse

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.