BizTalk WCF-Custom Behavior Extension not showing up

998 Views Asked by At

I have made the following behavior extension:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Discovery;

namespace Residence.WCFEndpointBehavior
{
    namespace Residence.WCFEndpointBehavior
    {
        public class MustUnderstandValidationOffElement : BehaviorExtensionElement
        {
            protected override object CreateBehavior()
            {
                return new MustUnderstandBehavior(false);
            }

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

The resulting assembly name is MustUnderstandValidationOffElement.

Version is 1.1.0.0

I put the assembly in the GAC.

GacUtil /lr MustUnderstandValidationOffElement

returns

MustUnderstandValidationOffElement, Version=1.1.0.0, Culture=neutral, PublicKeyToken=5f1263db97cf42d0, processorArchitecture=MSIL

In BizTalk 2013 R2 I open the WCF-Custom adapter for the relevant host name and import:

<configuration>
<system.serviceModel>
<extensions>
<behaviorExtensions>
  <add name="mustUnderstandValidationOffElement" type="Residence.WCFEndpointBehavior.MustUnderstandValidationOffElement, MustUnderstandValidationOffElement, Version=1.1.0.0, Culture=neutral, PublicKeyToken=5f1263db97cf42d0"/>
</behaviorExtensions>
</extensions>
</system.serviceModel>
</configuration>

in WCF-Custom Transport Properties.

Next I restart the host instance of the host.

I close the BizTalk Server Administration Console and open it again.

Next I open properties for the SendPort using the WCF-Custom adapter in the host -> Click configure and choose Bindings. I right click EndpointBehavior and select Add extension.

Alas - my "mustUnderstandValidationOffElement" does not show up in the list.

Any help is greatly appreciated!

1

There are 1 best solutions below

0
Birger Niss On

Thanks to Dijkgraaf for directing me to the solution. After creating a new specific strong name key for signing my endpoint behavior, it appeared in the Add extension list!

It worked without configuring the machine.config's

BUT Adding this behavior to the sendport did NOT prevent the sending of mustUnderstand=1 to the remote server. Instead it seems to make our Biztalk server ignore any mustUnderstand=1 i.e. quite the reverse of what we need.