public TransactionResponse( OwsHttpResponse response ) throws XMLProcessingException, OWSExceptionReport, XMLStreamException { this.response = response; this.load( response.getAsXMLStream() ); }
/** * Provides access to the feature objects and WFS provided information in the response. * * @return WFS feature collection, never <code>null</code> * * @throws OWSExceptionReport * @throws UnknownCRSException * @throws XMLStreamException * @throws XMLParsingException */ public WFSFeatureCollection<T> getAsWFSFeatureCollection() throws XMLParsingException, XMLStreamException, UnknownCRSException, OWSExceptionReport { return new WFSFeatureCollection<T>( response.getAsXMLStream(), gmlVersion, appSchema ); }
public GetRecordsResponse( OwsHttpResponse response ) throws XMLProcessingException, OWSExceptionReport, XMLStreamException { this.response = response; xmlStream = response.getAsXMLStream(); XMLStreamUtils.skipStartDocument( xmlStream ); XMLStreamUtils.moveReaderToFirstMatch( xmlStream, new QName( CSW_202_NS, "SearchResults" ) ); String noOfRecM = XMLStreamUtils.getAttributeValue( xmlStream, "numberOfRecordsMatched" ); numberOfRecordsMatched = noOfRecM != null ? Integer.parseInt( noOfRecM ) : 0; String noOfRecR = XMLStreamUtils.getAttributeValue( xmlStream, "numberOfRecordsReturned" ); numberOfRecordsReturned = noOfRecR != null ? Integer.parseInt( noOfRecR ) : 0; String nextRec = XMLStreamUtils.getAttributeValue( xmlStream, "nextRecord" ); nextRecord = nextRec != null ? Integer.parseInt( nextRec ) : 0; xmlStream.next(); while ( xmlStream.getEventType() != END_DOCUMENT && !xmlStream.isStartElement() && !xmlStream.isEndElement() ) { xmlStream.next(); } if ( xmlStream.getEventType() != END_DOCUMENT ) { recordElementName = xmlStream.getLocalName(); } }
public FeatureCollection getFeatures() throws OWSException, OWSExceptionReport { try { return FeatureInfoParser.parseAsFeatureCollection( rawResponse.getAsXMLStream(), request.getLayer() ); } catch ( XMLStreamException e ) { throw new OWSException( "Remote WMTS response was not recognized as feature collection: " + e.getLocalizedMessage(), e, OWSException.NO_APPLICABLE_CODE ); } }
public MetadataRecord getRecordById( String fileIdentifier, String schema ) throws IOException, OWSExceptionReport, XMLStreamException { URL endPoint = getGetUrl( "GetRecordById" ); Map<String, String> params = getGetRecordByIdKvpParams( fileIdentifier, schema ); OwsHttpResponse response = httpClient.doGet( endPoint, params, null ); XMLStreamReader xmlStream = response.getAsXMLStream(); XMLStreamUtils.skipStartDocument( xmlStream ); moveToNextStartElement( xmlStream ); return MetadataRecordFactory.create( xmlStream ); }
StreamBufferStore tmpStore = null; try { xmlStream = response.getAsXMLStream(); tmpStore = XMLStreamUtils.serialize( xmlStream ); } finally {
private void initCapabilities( URL capaUrl ) throws IOException, OWSExceptionReport, XMLStreamException { if ( shouldUseGet( capaUrl ) ) { OwsHttpResponse response = httpClient.doGet( capaUrl, null, null ); response.assertHttpStatus200(); XMLStreamReader responseAsXMLStream = response.getAsXMLStream(); try { XMLAdapter xmlAdapter = new XMLAdapter( responseAsXMLStream ); initCapabilities( xmlAdapter ); } finally { responseAsXMLStream.close(); response.close(); } } else { XMLAdapter xmlAdapter = new XMLAdapter( capaUrl ); initCapabilities( xmlAdapter ); } }
/** * Performs a <code>GetFeatureInfo</code> request and returns the response as a {@link FeatureCollection}. * * @param request * request parameter, must not be <code>null</code> * @param hardParams * raw parameters for augmenting overriding KVPs, must not be <code>null</code> * @return response parsed as feature collection, never <code>null</code> * @throws IOException * @throws OWSExceptionReport * @throws XMLStreamException */ public FeatureCollection doGetFeatureInfo( GetFeatureInfo request, Map<String, String> hardParams ) throws IOException, OWSExceptionReport, XMLStreamException { Map<String, String> params = buildGetFeatureInfoParamMap( request, hardParams ); overrideHardParams( params, hardParams ); OwsHttpResponse response = null; try { URL url = getGetUrl( GetFeatureInfo.name() ); response = httpClient.doGet( url, params, null ); response.assertHttpStatus200(); XMLStreamReader reader = response.getAsXMLStream(); String csvLayerNames = join( ",", request.getQueryLayers() ); return FeatureInfoParser.parseAsFeatureCollection( reader, csvLayerNames ); } finally { closeQuietly( response ); } }