none
System.InvalidOperationException ... ServiceEndpoint with contract 'IOneWayAsync' .... RRS feed

  • Question

  •  

    Using WCF LOB Adapter SDK SP1, changed one line of code within method MyAdapterBinding::

    CreateBindingElements() from:

     

    bindingElements.Add(this.BindingElement);

     

    to:

     

    bindingElements.Add(new OneWayBindingElement());

     

    and also put into both overloaded constructors of MyAdapter.cs:

     

    Settings.Messaging.SupportsTransactedInbound = true;

     

    DLL builds fine, but now when trying to enable BizTalk 2006 R2 receive location in which the custom adapter is configured I get:

    Event ID 5644

    The Messaging Engine failed to add a receive location "RcvLoc4" with URL "myscheme://myhost/?fubar=blah" to the adapter "WCF-Custom". Reason: "System.InvalidOperationException: The CustomBinding on the ServiceEndpoint with contract 'IOneWayAsync' lacks a TransportBindingElement.  Every binding must have at least one binding element that derives from TransportBindingElement.
       at System.ServiceModel.Channels.Binding.EnsureInvariants(String contractName)
       at System.ServiceModel.Description.ServiceEndpoint.EnsureInvariants()
       at System.ServiceModel.Description.ServiceDescription.EnsureInvariants()
       at System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost)
       at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
       at System.ServiceModel.ServiceHostBase.InitializeRuntime()
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.BtsServiceHostBase.InitializeRuntime()
       at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open()
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint.Enable()
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint..ctor(BizTalkEndpointContext endpointContext, IBTTransportProxy transportProxy, ControlledTermination control)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiver`2.AddReceiveEndpoint(String url, IPropertyBag adapterConfig, IPropertyBag bizTalkConfig)".

    For more information, see Help and Support Center at

     

     

    Any ideas ?

     

    Upgrading to .NET FW 3.0 SP1 did not help.  Rebooting machine and re-gac'ing didn't help.

     

     

     

     

    Tuesday, April 1, 2008 11:07 PM

Answers

  • Your binding class must derive from "AdapterBinding" (which is an ASDK class), and your adapter binding element must derive from "Adapter" (which is also an ASDK class).
    In the AdapterBinding::CreateBindingElements() function, you should add the OneWayBindingElement() before you add your Adapter-derived binding element.
    Wednesday, April 2, 2008 12:09 PM