Search in sources :

Example 1 with InsertResultTemplateResponseType

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

the class InsertResultTemplateResponseDecoder method decode.

@Override
public InsertResultTemplateResponse decode(XmlObject xmlObject) throws DecodingException {
    LOGGER.debug("REQUESTTYPE: {}", xmlObject != null ? xmlObject.getClass() : "null recevied");
    if (!(xmlObject instanceof InsertResultTemplateResponseDocument)) {
        throw new UnsupportedDecoderInputException(this, xmlObject);
    }
    InsertResultTemplateResponseDocument isrd = (InsertResultTemplateResponseDocument) xmlObject;
    InsertResultTemplateResponseType isr = isrd.getInsertResultTemplateResponse();
    if (isr == null) {
        throw new DecodingException("Received XML document is not valid. Set log level to debug to get more details");
    }
    InsertResultTemplateResponse decodedResponse = new InsertResultTemplateResponse(SosConstants.SOS, Sos2Constants.SERVICEVERSION);
    decodedResponse.setAcceptedTemplate(isr.getAcceptedTemplate());
    return decodedResponse;
}
Also used : InsertResultTemplateResponse(org.n52.shetland.ogc.sos.response.InsertResultTemplateResponse) InsertResultTemplateResponseDocument(net.opengis.sos.x20.InsertResultTemplateResponseDocument) DecodingException(org.n52.svalbard.decode.exception.DecodingException) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) InsertResultTemplateResponseType(net.opengis.sos.x20.InsertResultTemplateResponseType)

Example 2 with InsertResultTemplateResponseType

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

the class InsertResultTemplateResponseEncoder method create.

@Override
protected XmlObject create(InsertResultTemplateResponse response) throws EncodingException {
    InsertResultTemplateResponseDocument doc = InsertResultTemplateResponseDocument.Factory.newInstance(getXmlOptions());
    InsertResultTemplateResponseType irtr = doc.addNewInsertResultTemplateResponse();
    irtr.setAcceptedTemplate(response.getAcceptedTemplate());
    return doc;
}
Also used : InsertResultTemplateResponseDocument(net.opengis.sos.x20.InsertResultTemplateResponseDocument) InsertResultTemplateResponseType(net.opengis.sos.x20.InsertResultTemplateResponseType)

Aggregations

InsertResultTemplateResponseDocument (net.opengis.sos.x20.InsertResultTemplateResponseDocument)2 InsertResultTemplateResponseType (net.opengis.sos.x20.InsertResultTemplateResponseType)2 InsertResultTemplateResponse (org.n52.shetland.ogc.sos.response.InsertResultTemplateResponse)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)1