Search in sources :

Example 1 with WFSCapabilitiesType

use of org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType in project geo-platform by geosdi.

the class WFSGetCapabilitiesTest method testSecureV110.

@Test
public void testSecureV110() throws Exception {
    WFSGetCapabilitiesRequest<WFSCapabilitiesType> request = this.secureServerConnector.createGetCapabilitiesRequest();
    String responseAsString = request.formatResponseAsString(2);
    logger.info("WFS_110 Secure GetCapabilities @@@@@@@@@@@@@@@@@@@@@@@ \n{}\n", responseAsString);
    try (BufferedWriter writer = Files.newBufferedWriter(Paths.get("target/wfsSecureGetCapabilitiesv110.xml"))) {
        writer.write(responseAsString);
    }
}
Also used : WFSCapabilitiesType(org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType) BufferedWriter(java.io.BufferedWriter) Test(org.junit.Test)

Example 2 with WFSCapabilitiesType

use of org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType in project geo-platform by geosdi.

the class WFSGetCapabilitiesTest method testHttpsGetCapabilitiesV110.

@Test
public void testHttpsGetCapabilitiesV110() throws Exception {
    System.setProperty("jsse.enableSNIExtension", "false");
    WFSGetCapabilitiesRequest<WFSCapabilitiesType> request = this.httpsServerConnector.createGetCapabilitiesRequest();
    String responseAsString = request.formatResponseAsString(2);
    logger.info("WFS_110 HTTPS GetCapabilities @@@@@@@@@@@@@@@@@@@@@@@ \n{}\n", responseAsString);
    try (BufferedWriter writer = Files.newBufferedWriter(Paths.get("target/wfsSecureGetCapabilitiesv110.xml"))) {
        writer.write(responseAsString);
    }
}
Also used : WFSCapabilitiesType(org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType) BufferedWriter(java.io.BufferedWriter) Test(org.junit.Test)

Example 3 with WFSCapabilitiesType

use of org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType in project ddf by codice.

the class WfsSource method configureWfsFeatures.

private void configureWfsFeatures() {
    WFSCapabilitiesType capabilities = getCapabilities();
    if (capabilities != null) {
        wfsVersion = capabilities.getVersion();
        List<FeatureTypeType> featureTypes = getFeatureTypes(capabilities);
        buildFeatureFilters(featureTypes, capabilities.getFilterCapabilities());
    } else {
        LOGGER.debug("WfsSource {}: WFS Server did not return any capabilities.", getId());
    }
}
Also used : WFSCapabilitiesType(net.opengis.wfs.v_2_0_0.WFSCapabilitiesType) FeatureTypeType(net.opengis.wfs.v_2_0_0.FeatureTypeType)

Example 4 with WFSCapabilitiesType

use of org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType in project ddf by codice.

the class WfsSource method getCapabilities.

private WFSCapabilitiesType getCapabilities() {
    WFSCapabilitiesType capabilities = null;
    Wfs wfs = factory.getClient();
    try {
        capabilities = wfs.getCapabilities(new GetCapabilitiesRequest());
    } catch (WfsException wfse) {
        LOGGER.info(WFS_ERROR_MESSAGE + " Received HTTP code '{}' from server for source with id='{}'", wfse.getHttpStatus(), getId());
        LOGGER.debug(WFS_ERROR_MESSAGE, wfse);
    } catch (WebApplicationException wae) {
        LOGGER.debug(handleWebApplicationException(wae), wae);
    } catch (Exception e) {
        handleClientException(e);
    }
    return capabilities;
}
Also used : WFSCapabilitiesType(net.opengis.wfs.v_2_0_0.WFSCapabilitiesType) GetCapabilitiesRequest(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.GetCapabilitiesRequest) WebApplicationException(javax.ws.rs.WebApplicationException) Wfs(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs) WfsException(org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException) SSLHandshakeException(javax.net.ssl.SSLHandshakeException) WebApplicationException(javax.ws.rs.WebApplicationException) ConnectException(java.net.ConnectException) IOException(java.io.IOException) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) WfsException(org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException) InvalidSyntaxException(org.osgi.framework.InvalidSyntaxException) JAXBException(javax.xml.bind.JAXBException) CatalogTransformerException(ddf.catalog.transform.CatalogTransformerException)

Example 5 with WFSCapabilitiesType

use of org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType in project ddf by codice.

the class WfsSource method getCapabilities.

private WFSCapabilitiesType getCapabilities() {
    WFSCapabilitiesType capabilities = null;
    ExtendedWfs wfs = factory.getClient();
    try {
        capabilities = wfs.getCapabilities(new GetCapabilitiesRequest());
    } catch (WfsException wfse) {
        LOGGER.debug(WFS_ERROR_MESSAGE + " Received HTTP code '{}' from server for source with id='{}'", wfse.getHttpStatus(), getId(), wfse);
    } catch (WebApplicationException wae) {
        LOGGER.debug(handleWebApplicationException(wae), wae);
    } catch (Exception e) {
        handleClientException(e);
    }
    return capabilities;
}
Also used : WFSCapabilitiesType(net.opengis.wfs.v_1_1_0.WFSCapabilitiesType) GetCapabilitiesRequest(org.codice.ddf.spatial.ogc.wfs.v110.catalog.common.GetCapabilitiesRequest) WebApplicationException(javax.ws.rs.WebApplicationException) WfsException(org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException) SSLHandshakeException(javax.net.ssl.SSLHandshakeException) WebApplicationException(javax.ws.rs.WebApplicationException) ConnectException(java.net.ConnectException) IOException(java.io.IOException) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) WfsException(org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException) InvalidSyntaxException(org.osgi.framework.InvalidSyntaxException) JAXBException(javax.xml.bind.JAXBException) CatalogTransformerException(ddf.catalog.transform.CatalogTransformerException)

Aggregations

UnsupportedQueryException (ddf.catalog.source.UnsupportedQueryException)3 CatalogTransformerException (ddf.catalog.transform.CatalogTransformerException)3 BufferedWriter (java.io.BufferedWriter)3 IOException (java.io.IOException)3 ConnectException (java.net.ConnectException)3 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)3 WebApplicationException (javax.ws.rs.WebApplicationException)3 JAXBException (javax.xml.bind.JAXBException)3 WfsException (org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException)3 WFSCapabilitiesType (org.geosdi.geoplatform.xml.wfs.v110.WFSCapabilitiesType)3 Test (org.junit.Test)3 InvalidSyntaxException (org.osgi.framework.InvalidSyntaxException)3 WFSCapabilitiesType (net.opengis.wfs.v_1_1_0.WFSCapabilitiesType)2 WFSCapabilitiesType (net.opengis.wfs.v_2_0_0.WFSCapabilitiesType)2 WFSCapabilitiesType (ogc.schema.opengis.wfs_capabilities.v_1_0_0.WFSCapabilitiesType)2 ResourceNotFoundException (ddf.catalog.resource.ResourceNotFoundException)1 ResourceNotSupportedException (ddf.catalog.resource.ResourceNotSupportedException)1 SecurityServiceException (ddf.security.service.SecurityServiceException)1 QName (javax.xml.namespace.QName)1 FeatureTypeType (net.opengis.wfs.v_1_1_0.FeatureTypeType)1