use of org.n52.shetland.ogc.sos.response.InsertObservationResponse in project arctic-sea by 52North.
the class InsertObservationResponseV20Decoder method decode.
@Override
public InsertObservationResponse decode(XmlObject xmlObject) throws DecodingException {
LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
if (!(xmlObject instanceof InsertObservationResponseDocument)) {
throw new UnsupportedDecoderInputException(this, xmlObject);
}
InsertObservationResponseType isr = ((InsertObservationResponseDocument) xmlObject).getInsertObservationResponse();
if (isr == null) {
throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
}
return new InsertObservationResponse();
}
use of org.n52.shetland.ogc.sos.response.InsertObservationResponse in project arctic-sea by 52North.
the class InsertObservationResponseV20DecoderTest method shouldCreateInsertResultResponse.
@Test
public void shouldCreateInsertResultResponse() throws DecodingException {
InsertObservationResponseDocument isrd = InsertObservationResponseDocument.Factory.newInstance();
isrd.addNewInsertObservationResponse();
InsertObservationResponse decodedResponse = new InsertObservationResponseV20Decoder().decode(isrd);
assertThat(decodedResponse, is(notNullValue(InsertObservationResponse.class)));
}
Aggregations