Generating a WCF client proxy and application configuration files using the svcutil tool with metadata from a running service

Instructions for using the Microsoft svcutil.exe tool to generate a client for a service which is configured to use the IBM MQ custom channel for WCF.


Before starting

There are three prerequisites for using the svcutil tool to create to required configuration and proxy files which can be used directly by the application:

  • The WCF service must be running before the svcutil tool is started.
  • The WCF service must expose its metadata using an HTTP port in addition to the IBM MQ custom channel endpoint references to generate a client directly from a running service.
  • The custom channel must be registered in the configuration data for svcutil.


The following steps explain how to generate a client for a service which is configured to use the IBM MQ custom channel, but also exposes its metadata at run time via a separate HTTP port:

  1. Start the WCF service (The service must be running before the svcutil tool is started).
  2. Add the details from the svcutil.exe config file from the root of the installation, into the active svcutil configuration file, typically C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\svcutil.exe.config so svcutil recognizes the IBM MQ custom channel.
  3. Run svcutil from a command prompt, for example:
    svcutil /language:C# /r: installlocation\bin\IBM.XMS.WCF.dll
    /config:app.config http://localhost:8000/IBM.XMS.WCF/samples
    
  4. Copy the generated app.config and YourService.cs files to the Microsoft Visual studio client project.


What to do next

If the services metadata cannot be directly retrieved, svcutil can be used to generate the client files from wsdl instead. For more information see: Generating a WCF client proxy and application configuration files using the svcutil tool with WSDL Parent topic: Building client applications for WCF