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.
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:
- Import library references by means of the
usingstatement. - Create a server context object.
- Connect the server context to a running Integration Server.
- Populate the service inputs.
- Invoke one or more services.
- Retrieve the service outputs.
- Disconnect from Integration Server.
This same set of steps applies to both examples described in this chapter.