Editar

Partilhar via


Invoke request sets in Oracle E-Business Suite using the WCF service model

Microsoft BizTalk Adapter for Oracle E-Business Suite enables you to execute request sets in Oracle E-Business Suite. Request sets are divided into one or more stages, and each stage contains a set of reports and concurrent programs. For more information about how the adapter supports request sets, see Operations on Request Sets.

The WCF Client Class

The name of the WCF client generated for invoking the request sets by the Oracle E-Business adapter is listed in the following table.

Artifact WCF Client Name
Request Set RequestSets_[APP_NAME]Client

[APP_NAME] = Actual name of the Oracle E-Business Suite application; for example, SQLAP.

Method Signature for Invoking Request Sets

The following table shows the method signature for request sets.

Operation Method Signature
Request Set public <return type> <request set name>(param 1, param 2, …)

As an example, the following code shows the method signatures for a WCF client class generated for the reqset_singlestage request set.

Note

This is a custom request set and might not be available on your Oracle E-Business Solution instance.

public partial class RequestSets_SQLAPClient : System.ServiceModel.ClientBase<RequestSets_SQLAP>, RequestSets_SQLAP{      
  
    public string REQSTG(  
      schemas.microsoft.com.OracleEBS._2008._05.Options.SetRelClassOptions SetRelClassOptions,  
      schemas.microsoft.com.OracleEBS._2008._05.Options.SetPrintOptions SetPrintOptions,   
      schemas.microsoft.com.OracleEBS._2008._05.Options.SetRepeatOptions SetRepeatOptions,   
      schemas.microsoft.com.OracleEBS._2008._05.Options.SetNlsOptions SetNlsOptions,  
      string StartTime,  
      schemas.microsoft.com.OracleEBS._2008._05.RequestSetStage.SQLAP.REQSTG.set1 set1_set1);  
}  

In this snippet, RequestSets_SQLAPClient is the name of the WCF class in the OracleEBSBindingClient.cs generated by the Add Adapter Service Reference Plug-in. REQSTG is the name of the method to invoke the request set.

Creating a WCF Client to Invoke Request Sets

The generic set of actions required to perform an operation on Oracle E-Business Suite using a WCF client involves a set of tasks described in Overview of the WCF service model with the Oracle E-Business Suite adapter. This section describes how to create a WCF client to invoke the reqset_singlestage request set.

To create a WCF client

  1. Create a Visual C# project in Visual Studio. For this topic, create a console application.

  2. Generate the WCF client class for the reqset_singlestage request set. For more information about generating a WCF client class, see Generate a WCF client or a WCF service contract for Oracle E-Business Suite solution artifacts.

    Important

    Before generating the WCF client class, make sure you set the EnableBizTalkCompatibilityMode binding property to false.

  3. In the Solution Explorer, add reference to Microsoft.Adapters.OracleEBS and Microsoft.ServiceModel.Channels.

  4. Open the Program.cs file and add the following namespaces:

    • Microsoft.Adapters.OracleEBS

    • System.ServiceModel

  5. Open the Program.cs file and create a client as described in the snippet below.

    OracleEBSBinding binding = new OracleEBSBinding();  
    EndpointAddress address = new EndpointAddress("oracleebs://ebs_instance_name");  
    RequestSets_SQLAPClient client = new RequestSets_SQLAPClient(binding, address);  
    

    In this snippet, RequestSets_SQLAPClient is the WCF client defined in OracleEBSBindingClient.cs. This file is generated by the Add Adapter Service Reference Plug-in.

    Note

    In this snippet, you explicitly specify the binding and endpoint address in your application code. You can also use these values from the application configuration file, app.config, also generated by the Add Adapter Service Reference Plug-in. For more information about the different ways of specifying client binding, see Configure a client binding for the Oracle E-Business Suite.

  6. Set the credentials for the client.

    client.ClientCredentials.UserName.UserName = "myuser";  
    client.ClientCredentials.UserName.Password = "mypassword";  
    
  7. Because you are invoking request sets in an Oracle E-Business Suite application, you must set the application context. In this example, to set the application context, you specify the OracleUserName, OraclePassword, and OracleEBSResponsibilityName binding properties. For more information about application context, see Set application context.

    binding.OracleUserName = "myOracleEBSUserName";  
    binding.OraclePassword = "myOracleEBSPassword";  
    binding.OracleEBSResponsibilityName = "myOracleEBSResponsibility";  
    
  8. Open the client as described in the snippet below:

    try  
    {  
       Console.WriteLine("Opening Client...");  
       client.Open();  
    }  
    catch (Exception ex)  
    {  
       Console.WriteLine("Exception: " + ex.Message);  
       throw;  
    }  
    
  9. Invoke the reqset_singlestage request set.

    string RequestID;  
    
    schemas.microsoft.com.OracleEBS._2008._05.RequestSetStage.SQLAP.REQSTG.set1 param =  
        new schemas.microsoft.com.OracleEBS._2008._05.RequestSetStage.SQLAP.REQSTG.set1();  
    
    param.INSPARAMPROG = new schemas.microsoft.com.OracleEBS._2008._05.RequestSetConcurrentProgram.SQLAP.REQSTG.set1.SQLAP1.INSPARAMPROG();  
    param.INSPARAMPROG.p_id = "123";  
    param.INSPARAMPROG.p_name = "MyName";  
    
    try  
    {  
        Console.WriteLine("Invoking the reqset_singlestage request set");  
        RequestID = client.REQSTG(null, null, null, null, null, param);  
        Console.WriteLine("The request ID generated for the request set is : " + RequestID);  
        Console.WriteLine("*****************************************************************");  
        Console.WriteLine("\nHit <RETURN> to end");  
        Console.ReadLine();  
    }  
    catch (Exception ex)  
    {  
        Console.WriteLine("Exception : " + ex);  
        throw;  
    }  
    
  10. Close the client as described in the snippet below:

    client.Close();  
    
  11. Build the project and then run it. The application invokes the reqset_singlestage request set and returns a request ID, which is written to the console.

See Also

Develop Oracle E-Business Suite applications using the WCF Service Model