Search in sources :

Example 1 with CommunicationObjectWithSoapHeader

use of org.n52.iceland.service.CommunicationObjectWithSoapHeader in project arctic-sea by 52North.

the class SoapBinding method checkSoapInjection.

/**
 * Check if SoapHeader information is contained in the body response and add the header information to the
 * {@link SoapResponse}
 *
 * @param chain SoapChain to check
 */
private void checkSoapInjection(SoapChain chain) {
    if (chain.getBodyResponse() instanceof CommunicationObjectWithSoapHeader) {
        CommunicationObjectWithSoapHeader soapHeaderObject = (CommunicationObjectWithSoapHeader) chain.getBodyResponse();
        if (soapHeaderObject.isSetSoapHeader()) {
            List<SoapHeader> headers = ((CommunicationObjectWithSoapHeader) chain.getSoapRequest()).getSoapHeader();
            // TODO do things
            chain.getSoapResponse().setHeader(checkSoapHeaders(headers));
        }
    }
}
Also used : CommunicationObjectWithSoapHeader(org.n52.iceland.service.CommunicationObjectWithSoapHeader) CommunicationObjectWithSoapHeader(org.n52.iceland.service.CommunicationObjectWithSoapHeader) SoapHeader(org.n52.shetland.w3c.soap.SoapHeader)

Example 2 with CommunicationObjectWithSoapHeader

use of org.n52.iceland.service.CommunicationObjectWithSoapHeader 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);
}
Also used : SoapResponse(org.n52.shetland.w3c.soap.SoapResponse)

Aggregations

CommunicationObjectWithSoapHeader (org.n52.iceland.service.CommunicationObjectWithSoapHeader)1 SoapHeader (org.n52.shetland.w3c.soap.SoapHeader)1 SoapResponse (org.n52.shetland.w3c.soap.SoapResponse)1