public GetRecordsResponse getRecords( GetRecords getRecords ) throws IOException, XMLProcessingException, OWSExceptionReport, XMLStreamException { URL endPoint = getXMLPostUrl(); StreamBufferStore request = new StreamBufferStore(); try { XMLStreamWriter xmlWriter = XMLOutputFactory.newInstance().createXMLStreamWriter( request ); GetRecordsXMLEncoder.export( getRecords, xmlWriter ); xmlWriter.close(); request.close(); } catch ( Throwable t ) { throw new RuntimeException( "Error creating XML request: " + getRecords, t ); } OwsHttpResponse response = httpClient.doPost( endPoint, "text/xml", request, null ); return new GetRecordsResponse( response ); }