Generating Microsoft .NET Clients

Overview

The code samples in this chapter show two different methods of invoking a selected IBM webMethods service from the context of the Microsoft .NET environment. The invocation uses the IBM webMethods .NET API. The IBM webMethods .NET Client API functionality is supplied in a set of DLLs. You need to reference these DLLs by means of a using statement. The examples in this chapter do not create whole executables; rather, they show how to generate objects you can use in your own code.

For the first example, the IBM webMethods add-in for Microsoft Visual Studio allows you to select a service from a running Integration Server and generate a C# or Visual Basic class. This class encapsulates the integration service, allowing for interaction with the service in an object oriented way. This example is described in Invoking a Service using Visual Studio.

If you are familiar with the Java Client API for Integration Server, you may prefer to use the standard IData pipeline interface for invoking Integration Services. For more on using IData, see Invoking a Service using Java Client API from Designer.

Note: You can generate only C# code using the Java Client API for Integration Server 9.0 and higher. Visual Basic is not supported with Integration Server 9.0 and higher.

The Structure of Client Code

The .NET sample code is generated using the same structure as is used for generation of other language samples. This structure breaks essential elements out into separate routines. For purposes of simplification, we condense the essential elements of those samples into a more concise form. The essential elements of a .NET IBM webMethods client are:

  1. Import library references by means of the using statement.
  2. Create a server context object.
  3. Connect the server context to a running Integration Server.
  4. Populate the service inputs.
  5. Invoke one or more services.
  6. Retrieve the service outputs.
  7. Disconnect from Integration Server.

This same set of steps applies to both examples described in this chapter.