I recently went through the WCF LOB Adapter SDK Tutorial, and tried to use the echo adapter from BizTalk. It worked after a couple of tweaks.
Consuming the outbound part of the adapter involved the following gotchas:
- Remember to specify the SOAP header action in the send port properties.
- I hadn’t touched Abort() and ClearContext() in EchoAdapterConnection, either because I didn’t follow the tutorial properly or because it doesn’t say to do so. Either way, I got NotImplementedException. So I removed the line throwing this exception from these two methods.
When consuming the inbound part, I had trouble with the action. There is no place to input the action in the receive location configuration dialogue. And without action, I got the following error:
The Messaging Engine failed to update the configuration for the receive location "EchoAdapterSample" with URL "echov2://localhost/echolob?enableAuthentication=False" for adapter "WCF-Custom". Reason: "Microsoft.ServiceModel.Channels.Common.AdapterException: Unable to receive any actions for inbound handler to start listening.
The simplest way to solve this is to add an extra parameter action to the address, e.g. echov2://localhost/echolob?enableAuthentication=False&action=Echo/OnReceiveEcho.
A more complex (but perhaps cleaner) way is create a new endpoint behavior. This is described in How To: Obtain a list of receive actions when an ASDK-based Adapter is used with BizTalk in a Receive Location. One or more actions can now be input by inserting the new behavior on the Behavior tab. See the blog post Using EchoAdapter in BizTalk 2006 R2 for a screen shot.