public EnsureCredentialsUseContext(
            string username, string password, string accessKey, IContextChannel channel)
        {
            EsbCredentials credentials = new EsbCredentials
            {
                Username = username,
                Password = password,
            };

            _scope = new OperationContextScope(channel);
            MessageHeader<EsbCredentials> credentialsMessageHeader =
                new MessageHeader<EsbCredentials>(credentials);
            MessageHeader<string> accessKeyMessageHeader =
                new MessageHeader<string>(accessKey);

            OperationContext.Current.OutgoingMessageHeaders
                .Add(credentialsMessageHeader
                .GetUntypedHeader(Esbcredentials, HttpServicesSapoPtDefinitions));

            OperationContext.Current.OutgoingMessageHeaders
                .Add(accessKeyMessageHeader
                .GetUntypedHeader(Esbaccesskey, HttpServicesSapoPtMetadataMarket));
        }
Ejemplo n.º 2
0
        public EnsureCredentialsUseContext(
            string username, string password, string accessKey, IContextChannel channel)
        {
            EsbCredentials credentials = new EsbCredentials
            {
                Username = username,
                Password = password,
            };

            _scope = new OperationContextScope(channel);
            MessageHeader <EsbCredentials> credentialsMessageHeader =
                new MessageHeader <EsbCredentials>(credentials);
            MessageHeader <string> accessKeyMessageHeader =
                new MessageHeader <string>(accessKey);

            OperationContext.Current.OutgoingMessageHeaders
            .Add(credentialsMessageHeader
                 .GetUntypedHeader(Esbcredentials, HttpServicesSapoPtDefinitions));

            OperationContext.Current.OutgoingMessageHeaders
            .Add(accessKeyMessageHeader
                 .GetUntypedHeader(Esbaccesskey, HttpServicesSapoPtMetadataMarket));
        }