/** * @deprecated use {@link #SOSAdapter_OXFExtension(String)} instead * @param sosVersion * the SOS version. * @param requestBuilder * the custom request builder */ @Deprecated public SOSAdapter_OXFExtension(String sosVersion, ISOSRequestBuilder requestBuilder) { super(sosVersion, requestBuilder); setHttpClient(new SimpleHttpClient(5000, SOCKET_TIMEOUT)); }
/** * Allows to create an SOSAdapter with custom (non-default) instance of {@link ISOSRequestBuilder}.<br> * <br> * By default the created instance will use a {@link SimpleHttpClient} for service communication. If * further features are needed the {@link SimpleHttpClient} can be decorated with further configuration * setups like a {@link GzipEnabledHttpClient} or a {@link ProxyAwareHttpClient}. * * @param serviceVersion * the schema version for which this adapter instance shall be initialized. * @param requestBuilder * a custom request builder implementation, if <code>null</code> a default builder will be used * (according to the given version). * @see ISOSRequestBuilder */ public SOSAdapter(final String serviceVersion, final ISOSRequestBuilder requestBuilder) { httpClient = new SimpleHttpClient(); this.serviceVersion = serviceVersion; if (requestBuilder == null) { this.requestBuilder = SOSRequestBuilderFactory.generateRequestBuilder(serviceVersion); } else { this.requestBuilder = requestBuilder; } }
/** * @param sosVersion the SOS version the adapter shall connect to. */ public SOSAdapter_OXFExtension(String sosVersion) { super(sosVersion, new SimpleHttpClient(5000, SOCKET_TIMEOUT)); setRequestBuilder(SosRequestBuilderFactory.createRequestBuilder(sosVersion)); }
/** * Creates an adapter to connect SOS with SOAP binding. <br> * <br> * Per default the Adapter uses {@link SoapSOSRequestBuilder_200} to build its request. Override via * {@link #setRequestBuilder(ISOSRequestBuilder)}. * * @param sosVersion * the SOS version */ public SOSwithSoapAdapter(String sosVersion) { super(sosVersion, new SimpleHttpClient(5000, SOCKET_TIMEOUT)); setRequestBuilder(new SoapSOSRequestBuilder_200()); }
public static void main(final String[] args) { try { final HttpClient client = new SimpleHttpClient(); final String request = "http://sensorweb.demo.52north.org/52nSOSv3_200/sos?REQUEST=GetCapabilities&SERVICE=SOS"; final HttpResponse response = client.executeGet(request); final HttpEntity responseEntity = response.getEntity(); final InputStream responseStream = responseEntity.getContent(); new SOSCapabilitiesMapper_200().mapCapabilities(CapabilitiesDocument.Factory.parse(responseStream)); } catch (final HttpClientException | IOException | XmlException | OXFException e) { LOGGER.error("Exception thrown: {}",e.getMessage(),e); } }
/** * Creates an adapter to connect SOS with SOAP binding. <br> * <br> * We use the overloaded constructor {@link SOSAdapter#SOSAdapter(String, ISOSRequestBuilder)} just to * satisfy reflection loading. Actually, there is <b>no parameter needed</b> for * <code>requestBuilder</code> and is not looked at at all (so it can be <code>null</code>). The * constructor creates its own {@link SOSRequestBuilderGET_200} instance internally by itself. <br> * * @deprecated use {@link #SOSwithSoapAdapter(String)} instead * @param sosVersion * the SOS version * @param requestBuilder * only for satisfying reflection loading and can be <code>null</code>. */ public SOSwithSoapAdapter(String sosVersion, ISOSRequestBuilder requestBuilder) { super(sosVersion, new SoapSOSRequestBuilder_200()); setHttpClient(new SimpleHttpClient(5000, SOCKET_TIMEOUT)); LOGGER.warn("This is a deprecated constructor and will be removed soon w/o notice."); }
OXFException { if (connectionTimeout > 0 && readTimeout < 1) { httpClient = new GzipEnabledHttpClient(new ProxyAwareHttpClient(new SimpleHttpClient(connectionTimeout))); httpClient = new GzipEnabledHttpClient(new ProxyAwareHttpClient(new SimpleHttpClient(connectionTimeout, readTimeout)));
HttpClient httpClient = new ProxyAwareHttpClient(new SimpleHttpClient()); HttpResponse httpResponse = httpClient.executePost(this.sosUrl.trim(), getDataAvailability, ContentType.TEXT_XML); HttpEntity responseEntity = httpResponse.getEntity();
SoapSOSRequestBuilder_200 builder = (SoapSOSRequestBuilder_200) getRequestBuilder(); String request = builder.buildGetDataAvailabilityRequest(parameters); HttpClient httpClient = new ProxyAwareHttpClient(new SimpleHttpClient()); String url = operation.getDcps()[0].getHTTPGetRequestMethods().get(0).getOnlineResource().getHref(); HttpResponse httpResponse = httpClient.executePost(url, request, ContentType.TEXT_XML);
HttpClient httpClient = new ProxyAwareHttpClient(new SimpleHttpClient()); HttpResponse httpResponse = httpClient.executePost(uri, request); HttpEntity responseEntity = httpResponse.getEntity();