WCF binding configuration options
There are two ways of applying configuration options to the custom channels binding information. You either set the properties administratively, or set them programmatically.
The binding configuration options can be set in one of two different ways:
- Administratively: The binding property settings must be specified in the transport section of the custom binding definition in the applications configuration file, for example: app.config.
- Programmatically: The application code must be modified to specify the property during initialization of the custom binding.
Set the binding properties administratively
The binding property settings can be specified in the application configuration file, for example: app.config. The configuration file is generated by svcutil, as shown in the following examples.
- SOAP/JMS interface
-
<customBinding> ... <IBM.XMS.WCF.SoapJmsIbmTransportChannel maxBufferPoolSize="524288" maxMessageSize="4000000" clientConnectionMode="0" maxConcurrentCalls="16"/> ... </customBinding>
- Non-SOAP/Non-JMS interface
-
<customBinding> <IBM.WMQ.WCF.WmqMsgEncodingElement/> <IBM.WMQ.WCF.WmqIbmTransportChannel maxBufferPoolSize="524288" maxMessageSize="65536" clientConnectionMode="managedclient"/> </customBinding>
Set the binding properties programmatically
To add a WCF binding property to specify the client connection mode, modify the service code to specify the property during initialization of the custom binding.
Use the following example to specify unmanaged client connection mode:SoapJmsIbmTransportBindingElement transportBindingElement = new SoapJmsIbmTransportBindingElement(); transportBindingElement.ClientConnectionMode = XmsWCFBindingProperty.CLIENT_UNMANAGED; Binding sampleBinding = new CustomBinding(new TextMessageEncodingBindingElement(), transportBindingElement);
WCF binding properties
Property name | Client or Service application | Administrative value | Programmatic value | Description |
---|---|---|---|---|
maxBufferPoolSize | Both | 0 to 64 bit signed integer | 0 to 64 bit signed integer | Specifies the maximum size of the memory that can be used to store WCF message buffers for an instance of the channel. |
maxMessageSize | Both | 1 to 32 bit signed integer | 1 to 32 bit signed integer | Specifies the maximum memory that can be used for an individual WCF message. |
clientConnectionMode | Both | 0 (Default value)
1 |
AS_URI (Default value)
CLIENT_UNMANAGED |
Specifies the client connection mode of the transport channel.
0 means that the client connection mode is as specified in the URI. Only used if the client connection is used. Specifies that the client connection mode is as specified in the URI. 0 is the default value if no client connection mode is set. 1 means that the client connection mode is an unmanaged client. Only used if the client connection is used. |
MaxConcurrentCalls | Client | The range is 0 - 2 147 483 647
16 is the default value |
The range is 0 - 2 147 483 647
16 is the default value |
This property defines the maximum number of concurrent operations that can take place on an individual client proxy at any one time. If more operations are started, they are queued until an in-progress operation either completes or times out. This setting can be used to control the maximum threads and resources which can be consumed by an individual proxy.
0 removes this limit, enabling all operations to be attempted concurrently. |
MaxConcurrentCalls | Service | The range is 1 - 2 147 483 647
16 is the default value |
The range is 1 - 2 147 483 647
16 is the default value |
This property is only used if the assured delivery feature is enabled (For more information about assured delivery, see WCF custom channel assured delivery ). It specifies the maximum number of concurrent operations that can be in progress at the same time for the given endpoint.
Care is needed when changing this setting. Each concurrent operation requires additional resources, in particular a new instance of the custom channel and the associated threads from the thread pool to action the requests. Over-allocating can be counter productive and affect performance severely. Appropriate configuration of the thread pool must be made to support this property. |