Create a WCF custom channel administratively by supplying binding and endpoint information in an application configuration file

The IBM MQ custom channel for WCF is a transport level WCF channel. An endpoint and binding must be defined to use the custom channel, and these definitions can be done by supplying the binding and endpoint information in an application configuration file.

To configure and use the IBM MQ custom channel for WCF, which is a transport level WCF channel, a binding and an endpoint definition must be defined. The binding holds the configuration information for the channel, and the endpoint definition holds the connection details. These definitions can be created in two ways:

The client or service application configuration file is commonly named yourappname.exe.config where yourappname is the name of the application. The application configuration file is most easily modified by using the Microsoft service configuration editor tool called SvcConfigEditor.exe in the following way:

  • Start the SvcConfigEditor.exe configuration editor tool. The default installation location for the tool is: Drive:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\SvcConfigEditor.exe where Drive: is the name of the installation drive.


Step 1: Add a binding element extension to enable WCF to locate the custom channel

  1. Right-click Advanced > Extension > binding element to open the menu, and select New
  2. Complete the fields as shown in this table:

    Field Value
    Name IBM.XMS.WCF.SoapJmsIbmTransportChannel
    Type Navigate to IBM.XMS.WCF.dll in the Global Assembly Cache (GAC) and select IBM.XMS.WCFSoapJmsIbmTransportBindingElementConfig


Step 2: Create a custom binding definition which pairs the custom channel with a WCF message encoder

  1. Right-click Bindings to open the menu, and select New Binding Configuration
  2. Complete the fields as shown in this table:

    Field Value
    Name CustomBinding_WMQ
    BindingElement 1 textMessageEncoding (MessageVersion: Soap11)
    BindingElement 2 IBM.XMS.WCF.SoapJmsIbmTransportChannel


Step 3: Specify the binding properties

  1. Select the IBM.XMS.WCF.SoapJmsIbmTransportChannel transport binding from the binding you created in: Step 2: Create a custom binding definition which pairs the custom channel with a WCF message encoder
  2. Make any required changes to the default values of the properties as described in: WCF binding configuration options


Step 4: Create an endpoint definition

Create an endpoint definition which references the custom binding you created in: Step 2: Create a custom binding definition which pairs the custom channel with a WCF message encoder and provides the connection details of the service. The way this information is specified is dependent on whether the definition is for a client application or a service application. For a client application, add an endpoint definition to the client section as follows:
  1. Right-click Client > Endpoints to open the menu, and select New Client Endpoint
  2. Complete the fields as shown in this table:

    Field Value
    Name Endpoint_WMQ
    Address The SOAP/JMS URI describing the WMQ connection details required to access the service. For further details see: IBM MQ custom channel for WCF endpoint URI address format
    Binding customBinding
    BindingConfiguration CustomBinding_WMQ
    Contract The name of our service contract interface

For a service application, add a service definition to the services section as follows:

  1. Right-click Services to open the menu, and select New Service, then select the service class to be hosted.
  2. Add an endpoint definition to the Endpoints section for the new service, and complete the fields as shown in this table:

    Field Value
    Name Endpoint_WMQ
    Address The SOAP/JMS URI describing the WMQ connection details required to access the service. For further details see: IBM MQ custom channel for WCF endpoint URI address format
    Binding customBinding
    BindingConfiguration CustomBinding_WMQ
    Contract The name of our service implementation class

Parent topic: Create and configure the IBM MQ custom channel for WCF