Rediger

Del via


Overview of the WCF service model with the Siebel adapter

The Microsoft BizTalk Adapter for Siebel eBusiness Applications exposes a Siebel system as a WCF service. To perform operations on Siebel system artifacts, for example to invoke a method of a Siebel business service, you invoke an operation on the adapter, which, in turn, performs the operation on the Siebel system. Your code therefore acts as a client to the WCF service presented by the adapter.

In the Windows Communication Foundation (WCF) service model, the service contract that exists between a client and a service is represented as a .NET interface, and operations are represented as methods on this interface. The Siebel adapter and WCF provide tools that enable you to generate this interface for targeted operations from the metadata that the adapter exposes. These tools also create a WCF client class that can be used to invoke the operations exposed in the service interface. A client application can call the methods of the WCF client class to invoke operations on the adapter.

The following section explains how to use the WCF service model to invoke operations with a WCF client.

Invoking Operations on the Siebel System with a WCF Client

To use the WCF service model to invoke operations on the Siebel adapter, you must first generate a WCF client class for the target operations. You can then create an instance of this class, a WCF client, and call its methods to perform these operations on the Siebel system.

To invoke operations on the Siebel adapter

  1. Generate a WCF client class and helper code. Use the Add Adapter Service Reference Visual Studio Plug-in or the ServiceModel Metadata Utility Tool (svcutil.exe) to generate a WCF client class targeted at the Siebel system artifacts with which you want to work. For more information about how to generate a WCF client, see Generate a WCF Client or a WCF service contract for Siebel Solution Artifacts.

  2. Create a WCF client instance and configure the WCF client. Configuring the WCF client involves specifying the binding and endpoint address (connection URI) that the client will use. You can do this either imperatively in code or declaratively in configuration. For more information about how to configure the WCF client, see Configure a WCF Client for a Siebel System. The following code creates a WCF client that targets the Siebel TimeStamp business service. It also sets the credentials for the Siebel system. The WCF client is initialized from configuration.

    BusinessServices_TimeStamp_OperationClient client =  
        new BusinessServices_TimeStamp_OperationClient("SiebelBinding_BusinessServices_TimeStamp_Operation");  
    
    client.ClientCredentials.UserName.UserName = "YourUserName";  
    client.ClientCredentials.UserName.Password = "YourPassword";  
    
  3. Open the WCF client.

    client.Open();  
    
  4. Invoke methods on the WCF client created in step 2 to perform operations on the Siebel system. The following code invokes the Execute method of the WCF client to invoke the Execute method of the TimeStamp business service on the Siebel system.

    // Create a parameter to hold the results and then invoke the Execute method of the TimeStamp business service.  
    microsoft.lobservices.siebel._2007._03.BusinessServices.TimeStamp.ExecuteResponseRecord er;  
    er = client.Execute();  
    
  5. Close the WCF client.

    client.Close();  
    

    For more information about invoking Siebel business service methods, see Invoke Business Service Methods with the Siebel adapter using the WCF Service Model

See Also

Develop Siebel Applications using the WCF Service Model