use of org.n52.svalbard.decode.DecoderKey in project arctic-sea by 52North.
the class AbstractXmlBindingTest method test_GetCaps.
@Test
public void test_GetCaps() throws CodedException {
DecoderKey decoderKey = binding.getDecoderKey(xmlStringGetCaps, characterEncoding);
if (decoderKey instanceof OperationDecoderKey) {
assertThat(((OperationDecoderKey) decoderKey).getService(), is("SOS"));
assertThat(((OperationDecoderKey) decoderKey).getOperation(), is("GetCapabilities"));
}
}
use of org.n52.svalbard.decode.DecoderKey in project arctic-sea by 52North.
the class AbstractXmlBindingTest method test_SoapPrefix.
@Test
public void test_SoapPrefix() throws CodedException {
DecoderKey decoderKey = binding.getDecoderKey(xmlStringSoapPrefix, characterEncoding);
assertTrue(decoderKey instanceof XmlNamespaceOperationDecoderKey);
assertTrue(SoapConstants.NS_SOAP_12.equals(((XmlNamespaceOperationDecoderKey) decoderKey).getNamespace()));
}
use of org.n52.svalbard.decode.DecoderKey in project arctic-sea by 52North.
the class SoapBinding method createSoapResponse.
// private void parseBodyRequest(SoapChain chain) throws OwsExceptionReport,
// OwsExceptionReport {
//
// final XmlObject xmlObject = chain.getSoapRequest().getSoapBodyContent();
// DecoderKey key = CodingHelper.getDecoderKey(xmlObject);
// final Decoder<?, XmlObject> bodyDecoder = getDecoder(key);
// if (bodyDecoder == null) {
// throw new NoDecoderForKeyException(key).setStatus(BAD_REQUEST);
// }
// final Object aBodyRequest = bodyDecoder.decode(xmlObject);
// if (!(aBodyRequest instanceof AbstractServiceRequest)) {
// throw new NoApplicableCodeException().withMessage(
// "The returned object is not an AbstractServiceRequest implementation").setStatus(BAD_REQUEST);
// }
// AbstractServiceRequest bodyRequest = (AbstractServiceRequest)
// aBodyRequest;
// bodyRequest.setRequestContext(getRequestContext(chain.getHttpRequest()));
// if (bodyRequest instanceof CommunicationObjectWithSoapHeader) {
// ((CommunicationObjectWithSoapHeader)
// bodyRequest).setSoapHeader(chain.getSoapRequest().getSoapHeader());
// }
// chain.setBodyRequest(bodyRequest);
// }
private void createSoapResponse(SoapChain chain) {
SoapResponse soapResponse = new SoapResponse();
soapResponse.setSoapVersion(chain.getSoapRequest().getSoapVersion());
soapResponse.setSoapNamespace(chain.getSoapRequest().getSoapNamespace());
soapResponse.setHeader(checkSoapHeaders(chain.getSoapRequest().getSoapHeader()));
chain.setSoapResponse(soapResponse);
}
Aggregations