1

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!

8
  • You need to add entries to the machine.config files for it.
    – Dijkgraaf
    Commented Nov 14, 2020 at 23:03
  • Putting it in the machine.config files would alter the behavior on all WCF-Custom adapters. As I understand this is exactly the reason that BizTalk 2013 supports it. Commented Nov 15, 2020 at 10:15
  • azurebiztalkread.wordpress.com/2019/03/23/…
    – Dijkgraaf
    Commented Nov 16, 2020 at 23:42
  • Thanks Dijkgraaf! Did see this already - to no avail, though Commented Nov 17, 2020 at 6:52
  • Adding it to the machine.config should not alter the behavior of all the WCF-Custom adapters, only those where you select it in the End Point Behavior for that port. The exception your code does something that alters the behavior for everything running in that context, e.g. Setting the TLS version ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 This can be mitigated by running that port in a separate host instance from those you don't want to be impacted.
    – Dijkgraaf
    Commented Nov 17, 2020 at 21:20

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.