Search in sources :

Example 1 with InsertResultResponseDocument

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

the class InsertResultResponseEncoder method create.

@Override
protected XmlObject create(InsertResultResponse response) throws EncodingException {
    final InsertResultResponseDocument doc = InsertResultResponseDocument.Factory.newInstance(getXmlOptions());
    doc.addNewInsertResultResponse();
    return doc;
}
Also used : InsertResultResponseDocument(net.opengis.sos.x20.InsertResultResponseDocument)

Example 2 with InsertResultResponseDocument

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

the class InsertResultResponseDecoder method decode.

@Override
public InsertResultResponse decode(XmlObject xmlObject) throws DecodingException {
    LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
    if (!(xmlObject instanceof InsertResultResponseDocument)) {
        throw new UnsupportedDecoderInputException(this, xmlObject);
    }
    InsertResultResponseType isr = ((InsertResultResponseDocument) xmlObject).getInsertResultResponse();
    if (isr == null) {
        throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
    }
    return new InsertResultResponse();
}
Also used : InsertResultResponseType(net.opengis.sos.x20.InsertResultResponseType) DecodingException(org.n52.svalbard.decode.exception.DecodingException) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) InsertResultResponseDocument(net.opengis.sos.x20.InsertResultResponseDocument) InsertResultResponse(org.n52.shetland.ogc.sos.response.InsertResultResponse)

Example 3 with InsertResultResponseDocument

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

the class InsertResultResponseDecoderTest method shouldCreateInsertResultResponse.

@Test
public void shouldCreateInsertResultResponse() throws DecodingException {
    InsertResultResponseDocument isrd = InsertResultResponseDocument.Factory.newInstance();
    isrd.addNewInsertResultResponse();
    InsertResultResponse decodedResponse = new InsertResultResponseDecoder().decode(isrd);
    assertThat(decodedResponse, is(notNullValue(InsertResultResponse.class)));
}
Also used : InsertResultResponseDocument(net.opengis.sos.x20.InsertResultResponseDocument) InsertResultResponse(org.n52.shetland.ogc.sos.response.InsertResultResponse) Test(org.junit.Test)

Aggregations

InsertResultResponseDocument (net.opengis.sos.x20.InsertResultResponseDocument)3 InsertResultResponse (org.n52.shetland.ogc.sos.response.InsertResultResponse)2 InsertResultResponseType (net.opengis.sos.x20.InsertResultResponseType)1 Test (org.junit.Test)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)1