use of net.opengis.sos.x20.GetCapabilitiesType in project arctic-sea by 52North.
the class SosDecoderv20 method parseGetCapabilities.
/**
* parses the XmlBean representing the getCapabilities request and creates a
* SosGetCapabilities request
*
* @param getCapsDoc
* XmlBean created from the incoming request stream
* @return Returns SosGetCapabilitiesRequest representing the request
*
* @throws DecodingException
* * If parsing the XmlBean failed
*/
private OwsServiceRequest parseGetCapabilities(final GetCapabilitiesDocument getCapsDoc) throws DecodingException {
final GetCapabilitiesType getCapsType = getCapsDoc.getGetCapabilities2();
final GetCapabilitiesRequest request = new GetCapabilitiesRequest(getCapsType.getService());
if (getCapsType.getAcceptFormats() != null && getCapsType.getAcceptFormats().sizeOfOutputFormatArray() != 0) {
request.setAcceptFormats(Arrays.asList(getCapsType.getAcceptFormats().getOutputFormatArray()));
}
if (getCapsType.getAcceptVersions() != null && getCapsType.getAcceptVersions().sizeOfVersionArray() != 0) {
request.setAcceptVersions(Arrays.asList(getCapsType.getAcceptVersions().getVersionArray()));
}
if (getCapsType.getSections() != null && getCapsType.getSections().getSectionArray().length != 0) {
request.setSections(Arrays.asList(getCapsType.getSections().getSectionArray()));
}
if (getCapsType.getExtensionArray() != null && getCapsType.getExtensionArray().length > 0) {
request.setExtensions(parseExtensibleRequestExtension(getCapsType.getExtensionArray()));
}
return request;
}
use of net.opengis.sos.x20.GetCapabilitiesType in project arctic-sea by 52North.
the class GetCapabilitiesRequestEncoder method create.
@Override
protected XmlObject create(GetCapabilitiesRequest request) throws EncodingException {
GetCapabilitiesDocument doc = GetCapabilitiesDocument.Factory.newInstance(getXmlOptions());
GetCapabilitiesType gct = doc.addNewGetCapabilities2();
addService(gct, request);
addAcceptVersion(gct, request);
addSections(gct, request);
return doc;
}
use of net.opengis.sos.x20.GetCapabilitiesType in project ddf by codice.
the class TestCswEndpoint method createDefaultGetCapabilitiesType.
/**
* Creates default GetCapabilities POST request, with no sections specified
*
* @return Vanilla GetCapabilitiesType object
*/
private GetCapabilitiesType createDefaultGetCapabilitiesType() {
GetCapabilitiesType gct = new GetCapabilitiesType();
gct.setService(CswConstants.CSW);
AcceptVersionsType avt = new AcceptVersionsType();
avt.setVersion(CswEndpoint.SERVICE_TYPE_VERSION);
gct.setAcceptVersions(avt);
return gct;
}
use of net.opengis.sos.x20.GetCapabilitiesType in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeNoSections.
@Test
public void testGetCapabilitiesTypeNoSections() {
// Should return all sections
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
gct.setSections(null);
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
verifyOperationsMetadata(ct);
verifyServiceIdentification(ct);
verifyServiceProvider(ct);
verifyFilterCapabilities(ct);
}
use of net.opengis.sos.x20.GetCapabilitiesType in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeOperationsMetadata.
@Test
public void testGetCapabilitiesTypeOperationsMetadata() {
// Should only return the OperationsMetadata section
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList(CswEndpoint.OPERATIONS_METADATA));
gct.setSections(stv);
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} catch (CswException e) {
fail("CswException caught during getCapabilities GET request: " + e.getMessage());
}
assertThat(ct, notNullValue());
verifyOperationsMetadata(ct);
verifyFilterCapabilities(ct);
assertThat(ct.getServiceIdentification(), nullValue());
assertThat(ct.getServiceProvider(), nullValue());
}
Aggregations