private void SetSinkProperties(IMessage msg)
        {
            if (!_authenticationParamsSet)
            {
                String url = (String)msg.Properties["__Uri"];

                UrlAuthenticationEntry entr =
                    UrlAuthenticator.GetAuthenticationEntry(url);

                if (entr != null)
                {
                    IClientChannelSink last = this;

                    while (last.NextChannelSink != null)
                    {
                        last = last.NextChannelSink;
                    }

                    // last now contains the transport channel sink

                    last.Properties["username"] = entr.Username;
                    last.Properties["password"] = entr.Password;
                }



                _authenticationParamsSet = true;
            }
        }
Exemplo n.º 2
0
 public static void SetDefaultAuthenticationEntry(String userName,
                                                  String password)
 {
     _defaultAuthenticationEntry = new UrlAuthenticationEntry(
         null, userName, password);
 }