Creating a client application (.NET)

A client application sends requests to and receives responses from the Web services APIs. By using a proxy client to manage communications and helper classes to format complex data types, a client application can invoke Web service methods as if they were local functions.

Before you begin

Before starting to create a client application, generate the proxy client and any necessary helper classes.

Why and when to perform this task

You can develop .NET client applications using any .NET-compatible development tool, for example, Visual Studio .NET. You can build any type of .NET application to call the generic Web service APIs.

Steps for this task

  1. Create a new client application project. For example, create a WinFX Windows® Application in Visual Studio.
  2. In the project options, add a reference to the Dynamic Link Library (DLL) file of the proxy client. Add all of the helper classes that contain business object definitions to your project. In Visual Studio, for example, you can do this using the Project > Add existing item option.
  3. Create a proxy client object. For example:
    HTMClient.HTMReference.HumanTaskManagerComponent1Export_HumanTaskManagerHttpService service = 
        new HTMClient.HTMReference.HumanTaskManagerComponent1Export_HumanTaskManagerHttpService();
  4. Declare any business object data types used in messages to be sent to or received from the Web service. For example:
    HTMClient.HTMReference.TKIID id = new HTMClient.HTMReference.TKIID();
    
    ClipBG bg = new ClipBG();
    Clip clip = new Clip();
  5. Call specific Web service functions and specify any required parameters. For example, to create and start a human task:
    HTMClient.HTMReference.createAndStartTask task = 
       new HTMClient.HTMReference.createAndStartTask();
    HTMClient.HTMReference.StartTask sTask = new HTMClient.HTMReference.StartTask();
    
    sTask.taskName = "SimpleTask";
    sTask.taskNamespace = "http://myProcess/com/acme/task";
    sTask.inputMessage = bg;
    task.inputTask = sTask;
    
    id = service.createAndStartTask(task).outputTask;
  6. Remote processes and tasks are identified with persistent IDs (id in the example in the previous step). For example, to claim a previously created human task:
    HTMClient.HTMReference.claimTask claim = new HTMClient.HTMReference.claimTask();
    claim.inputTask = id;
Related tasks
Generating a proxy client (.NET)
Creating helper classes for BPEL processes (.NET)

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)