internal override void ConfigureInternalSend(InternalSendMessage internalSendMessage, out ToRequest requestFormatter) { requestFormatter = new ToRequest(); foreach (KeyValuePair <string, InArgument> pair in this.Parameters) { requestFormatter.Parameters.Add(InArgument.CreateReference(pair.Value, pair.Key)); } }
internal override void ConfigureInternalSend(InternalSendMessage internalSendMessage, out ToRequest requestFormatter) { requestFormatter = new ToRequest(); foreach (KeyValuePair<string, InArgument> pair in this.Parameters) { requestFormatter.Parameters.Add(InArgument.CreateReference(pair.Value, pair.Key)); } }
internal override void ConfigureInternalSend(InternalSendMessage internalSendMessage, out ToRequest requestFormatter) { if (this.InternalDeclaredMessageType == MessageDescription.TypeOfUntypedMessage) { internalSendMessage.Message = new InArgument <System.ServiceModel.Channels.Message>(context => ((InArgument <System.ServiceModel.Channels.Message>) this.Message).Get(context)); requestFormatter = null; } else { requestFormatter = new ToRequest(); if (this.Message != null) { requestFormatter.Parameters.Add(InArgument.CreateReference(this.Message, "Message")); } } }
internal override void ConfigureInternalSend(InternalSendMessage internalSendMessage, out ToRequest requestFormatter) { if (this.InternalDeclaredMessageType == MessageDescription.TypeOfUntypedMessage) { // Value is a Message, do not use the formatter but directly pass it to InternalSendMessage internalSendMessage.Message = new InArgument <Message>(context => ((InArgument <Message>) this.Message).Get(context)); requestFormatter = null; } else { requestFormatter = new ToRequest(); if (this.Message != null) { requestFormatter.Parameters.Add(InArgument.CreateReference(this.Message, "Message")); } } }
protected override void CacheMetadata(ActivityMetadata metadata) { if (string.IsNullOrEmpty(this.OperationName)) { metadata.AddValidationError(System.ServiceModel.Activities.SR.MissingOperationName(base.DisplayName)); } if (this.ServiceContractName == null) { string errorMessageOperationName = ContractValidationHelper.GetErrorMessageOperationName(this.OperationName); metadata.AddValidationError(System.ServiceModel.Activities.SR.MissingServiceContractName(base.DisplayName, errorMessageOperationName)); } if (this.Endpoint == null) { if (string.IsNullOrEmpty(this.EndpointConfigurationName)) { metadata.AddValidationError(System.ServiceModel.Activities.SR.EndpointNotSet(base.DisplayName, this.OperationName)); } } else { if (!string.IsNullOrEmpty(this.EndpointConfigurationName)) { metadata.AddValidationError(System.ServiceModel.Activities.SR.EndpointIncorrectlySet(base.DisplayName, this.OperationName)); } if (this.Endpoint.Binding == null) { metadata.AddValidationError(System.ServiceModel.Activities.SR.MissingBindingInEndpoint(this.Endpoint.Name, this.ServiceContractName)); } } MessagingActivityHelper.ValidateCorrelationInitializer(metadata, this.correlationInitializers, false, base.DisplayName, this.OperationName); MessagingActivityHelper.AddRuntimeArgument(this.CorrelatesWith, "CorrelatesWith", System.ServiceModel.Activities.Constants.CorrelationHandleType, ArgumentDirection.In, metadata); MessagingActivityHelper.AddRuntimeArgument(this.EndpointAddress, "EndpointAddress", System.ServiceModel.Activities.Constants.UriType, ArgumentDirection.In, metadata); this.InternalContent.CacheMetadata(metadata, this, this.OperationName); if (this.correlationInitializers != null) { for (int i = 0; i < this.correlationInitializers.Count; i++) { CorrelationInitializer initializer = this.correlationInitializers[i]; initializer.ArgumentName = "Parameter" + i; RuntimeArgument argument = new RuntimeArgument(initializer.ArgumentName, System.ServiceModel.Activities.Constants.CorrelationHandleType, ArgumentDirection.In); metadata.Bind(initializer.CorrelationHandle, argument); metadata.AddArgument(argument); } } if (!metadata.HasViolations) { if ((this.InternalContent is SendMessageContent) && MessageBuilder.IsMessageContract(((SendMessageContent)this.InternalContent).InternalDeclaredMessageType)) { this.OperationUsesMessageContract = true; } this.internalSend = this.CreateInternalSend(); this.InternalContent.ConfigureInternalSend(this.internalSend, out this.requestFormatter); if ((this.requestFormatter != null) && (this.lazyFormatter != null)) { this.requestFormatter.Formatter = this.lazyFormatter; } } else { this.internalSend = null; this.requestFormatter = null; } }
internal abstract void ConfigureInternalSend(InternalSendMessage internalSendMessage, out ToRequest requestFormatter);
internal override void ConfigureInternalSend(InternalSendMessage internalSendMessage, out ToRequest requestFormatter) { if (this.InternalDeclaredMessageType == MessageDescription.TypeOfUntypedMessage) { // Value is a Message, do not use the formatter but directly pass it to InternalSendMessage internalSendMessage.Message = new InArgument<Message>(context => ((InArgument<Message>)this.Message).Get(context)); requestFormatter = null; } else { requestFormatter = new ToRequest(); if (this.Message != null) { requestFormatter.Parameters.Add(InArgument.CreateReference(this.Message, "Message")); } } }
protected override void CacheMetadata(ActivityMetadata metadata) { if (string.IsNullOrEmpty(this.OperationName)) { metadata.AddValidationError(SR.MissingOperationName(this.DisplayName)); } if (this.ServiceContractName == null) { string errorOperationName = ContractValidationHelper.GetErrorMessageOperationName(this.OperationName); metadata.AddValidationError(SR.MissingServiceContractName(this.DisplayName, errorOperationName)); } if (this.Endpoint == null) { if (string.IsNullOrEmpty(this.EndpointConfigurationName)) { metadata.AddValidationError(SR.EndpointNotSet(this.DisplayName, this.OperationName)); } } else { if (!string.IsNullOrEmpty(this.EndpointConfigurationName)) { metadata.AddValidationError(SR.EndpointIncorrectlySet(this.DisplayName, this.OperationName)); } if (this.Endpoint.Binding == null) { metadata.AddValidationError(SR.MissingBindingInEndpoint(this.Endpoint.Name, this.ServiceContractName)); } } // validate Correlation Initializers MessagingActivityHelper.ValidateCorrelationInitializer(metadata, this.correlationInitializers, false, this.DisplayName, this.OperationName); // Add runtime arguments MessagingActivityHelper.AddRuntimeArgument(this.CorrelatesWith, "CorrelatesWith", Constants.CorrelationHandleType, ArgumentDirection.In, metadata); MessagingActivityHelper.AddRuntimeArgument(this.EndpointAddress, "EndpointAddress", Constants.UriType, ArgumentDirection.In, metadata); // Validate Content this.InternalContent.CacheMetadata(metadata, this, this.OperationName); if (this.correlationInitializers != null) { for (int i = 0; i < this.correlationInitializers.Count; i++) { CorrelationInitializer initializer = this.correlationInitializers[i]; initializer.ArgumentName = Constants.Parameter + i; RuntimeArgument initializerArgument = new RuntimeArgument(initializer.ArgumentName, Constants.CorrelationHandleType, ArgumentDirection.In); metadata.Bind(initializer.CorrelationHandle, initializerArgument); metadata.AddArgument(initializerArgument); } } if (!metadata.HasViolations) { if (this.InternalContent is SendMessageContent && MessageBuilder.IsMessageContract(((SendMessageContent)this.InternalContent).InternalDeclaredMessageType)) { this.OperationUsesMessageContract = true; } this.internalSend = CreateInternalSend(); this.InternalContent.ConfigureInternalSend(this.internalSend, out this.requestFormatter); if (this.requestFormatter != null && this.lazyFormatter != null) { this.requestFormatter.Formatter = this.lazyFormatter; } } else { this.internalSend = null; this.requestFormatter = null; } }
internal abstract void ConfigureInternalSend(InternalSendMessage internalSendMessage, out ToRequest requestFormatter);