I'm trying to implement my own version of the Custom Behavior shown here: Using Windows Credentials in WCF-Custom adapter and here: Impersonate WCF Credentials when calling a WCF Service
BizTalk requires everything to be put in the GAC, which I did by running GacUtil.
I attempted the following changes to machine.config, and I know they didn't work because if I restart the BizTalk Host Instance, I get bizarre errors.
Changed from this:
<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
To this:
<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<add name="WindowsCredentialsBehaviour" type="MyApp.Biztalk.WCF.Extensions.ImpersonateBasicCredentialsBehaviour, MyApp.CustomEndpointBehavior, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b12735283a466be4" />
</section>
In BizTalk, the Assembly looks like this:
MyApp.CustomEndpointBehavior, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b12735283a466be4"
So I have two main questions:
- I'm not sure why in the config file there are two names, is one the class or behavior name, and the second is the assembly name?
- What did I do wrong?
Here are my namespaces:
namespace MyApp.Biztalk.WCF.Extensions
{
public class ImpersonateBasicCredentialsBehaviour : IEndpointBehavior
...
namespace MyApp.Biztalk.WCF.Extensions
{
public class ImpersonateBasicCredentialsBehaviourElement : BehaviorExtensionElement
...
I also tried to edit machine.config with the SDK tool: SvcConfigEditor.exe, but it gave this error, so I was left to edit in NotePad++.