public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg) { object isRequestResponse; object epmRRCorrelationToken; object correlationToken; object reqRespTransmitPipelineID; if (!pInMsg.Context.TryRead(new ContextProperty(SystemProperties.IsRequestResponse), out isRequestResponse)) { throw new InvalidOperationException("This component can only be used on request response ports."); } if (!pInMsg.Context.TryRead(new ContextProperty(SystemProperties.EpmRRCorrelationToken), out epmRRCorrelationToken)) { throw new InvalidOperationException("The request message is missing it's correlation token"); } if (!pInMsg.Context.TryRead(new ContextProperty(SystemProperties.CorrelationToken), out correlationToken)) { throw new InvalidOperationException("The request message is missing it's correlation token"); } if (!pInMsg.Context.TryRead(new ContextProperty(SystemProperties.ReqRespTransmitPipelineID), out reqRespTransmitPipelineID)) { throw new InvalidOperationException("The request is missing the context property ReqRespTransmitPipelineID"); } var validator = new XmlValidator { RecoverableInterchangeProcessing = RecoverableInterchangeProcessing }; try { pInMsg = validator.Execute(pContext, pInMsg); } catch (XmlValidatorException ex) { pInMsg = GetValidationErrorResponse(pContext, pInMsg, epmRRCorrelationToken, correlationToken, reqRespTransmitPipelineID, ex); } return(pInMsg); }