Search in sources :

Example 1 with InsertObservationResponseDocument

use of net.opengis.sos.x20.InsertObservationResponseDocument 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();
}
Also used : InsertObservationResponseDocument(net.opengis.sos.x20.InsertObservationResponseDocument) DecodingException(org.n52.svalbard.decode.exception.DecodingException) InsertObservationResponseType(net.opengis.sos.x20.InsertObservationResponseType) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) InsertObservationResponse(org.n52.shetland.ogc.sos.response.InsertObservationResponse)

Example 2 with InsertObservationResponseDocument

use of net.opengis.sos.x20.InsertObservationResponseDocument in project arctic-sea by 52North.

the class InsertObservationResponseEncoder method create.

@Override
protected XmlObject create(InsertObservationResponse response) throws EncodingException {
    InsertObservationResponseDocument doc = InsertObservationResponseDocument.Factory.newInstance(getXmlOptions());
    doc.addNewInsertObservationResponse();
    return doc;
}
Also used : InsertObservationResponseDocument(net.opengis.sos.x20.InsertObservationResponseDocument)

Example 3 with InsertObservationResponseDocument

use of net.opengis.sos.x20.InsertObservationResponseDocument 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)));
}
Also used : InsertObservationResponseDocument(net.opengis.sos.x20.InsertObservationResponseDocument) InsertObservationResponse(org.n52.shetland.ogc.sos.response.InsertObservationResponse) Test(org.junit.Test)

Aggregations

InsertObservationResponseDocument (net.opengis.sos.x20.InsertObservationResponseDocument)3 InsertObservationResponse (org.n52.shetland.ogc.sos.response.InsertObservationResponse)2 InsertObservationResponseType (net.opengis.sos.x20.InsertObservationResponseType)1 Test (org.junit.Test)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)1