BizTalk Service Authorization

I'm trying to implement authorization as Seroter described here (Service Authorization section). I've GAC'ed the library, changed machine.config and able to pick the custom behavior in Select Behavior Extension dialog. But I can't set the 'WindowsGroup' value, it gives me "Object reference not set to an instance of an object" and I can't figure why. Did anybody implement service authorization?

Answers


Finally solved this problem.

using System;
using System.Configuration;
using System.ServiceModel.Configuration;

namespace Esb.Service.Authorization
{
    public class EsbBehaviorElement : BehaviorExtensionElement
    {
        private const string _windowsgroupIndexName = "windowsgroup";

        public EsbBehaviorElement()
        {
            if (!base.Properties.Contains(_windowsgroupIndexName))
            {
                base.Properties.Add(new ConfigurationProperty(_windowsgroupIndexName, typeof(string)));
            }
        }

        [ConfigurationProperty("WindowsGroup", IsRequired = false, DefaultValue = "")]
        public string WindowsGroup
        {
            get
            {
                return (string)base[_windowsgroupIndexName];
            }
            set
            {
                base[_windowsgroupIndexName] = value;
            }
        }

        public override Type BehaviorType
        {
            get
            {
                return typeof(EsbServiceBehavior);
            }
        }

        protected override object CreateBehavior()
        {
            return new EsbServiceBehavior(WindowsGroup);
        }
    }
}

I don't know why Seroter's solution works without ctor where one should add "windowsgroup" property to the base collection of properties.


Need Your Help

Facebook API Adobe Air review

facebook facebook-graph-api air

I've an application which uses Facebook API and requires permissions:publish_actions, manage_pages. According to new FB policy I should send my application for approve to FB.

WCF wsHttpBinding + Windows Authentication failing over SSL

.net wcf web-config ninject config

This service worked no problem without SSL, but it is failing when using SSL. I will assume it is a configuration error and post the relevant config files

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.