<commit_before>WCF-NULLAdapter
===============

A /dev/null WCF LOB adapter for use with BizTalk.<commit_msg>Add documentation in the README.md file.<commit_after>WCF-NULLAdapter
===============

# Description

A /dev/null WCF LOB adapter binding for use with the BizTalk 2013 WCF-Custom adapter.

# Purpose

This binding is useful for situations where a system is sending a stream of messages to BizTalk and some of these messages will not have a subscriber. Instead of getting spurious routing errors this adapter can be used to subscribe to these messages and terminate them.
This project has the dual goals of being a learning experience for building a WCF LOB adapter and to create a NULL adapter with an explicit open source license.

# Limitations

This only functions as binding for the WCF-Custom adapter. I have been unable to find any documentation on registering an adapter built with the WCF LOB SDK as a physical adapter. Apparently Microsoft does not want developers to do this.
This adapter only supports outbound synchronous (one-way) communication. I cannot think of any scenarios where it would make sense to support inbound or asynchronous communication.

# Installation

## Prerequisites

For BizTalk 2013 you will need Visual Studion 2012 with the BizTalk developer tools installed to build the solution.

## Build and Install the Adapter

1. Open the solution in Visual Studio 2012 and build the assembly.
2. Open a Visual Studio commmand prompt and navigate to the folder with the adapter assembly.
3. Run `gacutil /i StoneDonut.Adapters.Null.dll` to place the compiled assembly into the GAC.
4. Run `installutil StoneDonut.Adapters.Null.dll` to create the custom event log source.

## Configure the Adapter

1. Add an entry to the bindingElementExtensions section of the machine.config file under C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config:
```xml
<bindingElementExtensions>
  ...
  <add name="nullAdapter" type="StoneDonut.Adapters.Null.WcfNullAdapterBindingElementExtensionElement, StoneDonut.Adapters.Null, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<KEY>" />
 </bindingElementExtensions>
```
2. Add an entry to the bindingExtensions section of the machine.config file under C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config:
```xml
<bindingExtensions>
  <add name="nullBinding" type="StoneDonut.Adapters.Null.WcfNullAdapterBindingCollectionElement, StoneDonut.Adapters.Null, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<KEY>" />
</bindingExtensions>
```
3. Repeat steps 1. and 2. for the machine.config file under C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config.

## Configure a Send Port

1. Open the BizTalk administration console.
2. Create a new static, one-way send port.
3. Choose the WCF-Custom adapter and click on the **Configure** button.
4. Under the **Binding** tab select **nullBinding** from the drop-down list.
5. (Optional) Enable the event log support by setting the **enableEventLog** property to **True**.

# Acknowledgements

Hat tip to <NAME> for his [nulladapter](https://github.com/tomasr/nulladapter) project for providing the inspiration to try this using the WCF LOB SDK.
{'fraction_non_alphanumeric': 0.08108964206525182, 'fraction_numerical': 0.019322141273360786, 'mean_word_length': 4.837338262476894, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1579834', 'n_tokens_mistral': 902, 'n_tokens_neox': 832, 'n_words': 389}