Export (0) Print
Expand All

Creating a Channel

In the WCF channel model, you invoke operations on the Oracle E-Business Suite and receive the results by exchanging SOAP messages with the Microsoft BizTalk Adapter for Oracle E-Business Suite over a WCF channel.

  • You invoke operations (outbound operations) by using either an IRequestChannel or an IOutputChannel to send messages to the adapter.

  • You receive messages for inbound operations over an IInputChannel.

The topics in this section provide information about how to create and configure channel shapes that are used for inbound and outbound operations.

You can use either an IRequestChannel or an IOutputChannel to invoke operations on the Oracle E-Business Suite. In either case, you first create a System.ServiceModel.ChannelFactory using the appropriate interface. You then use the factory to create the channel. After you have created the channel you can use it to invoke operations on the adapter.

To create and open an outbound channel
  1. Create and initialize an instance of ChannelFactory for the desired channel shape by using an endpoint and a binding. The endpoint specifies an Oracle E-Business Suite connection URI and the binding is an instance of OracleEBSBinding.

  2. Provide Oracle E-Business Suite credentials for the channel factory by using the Credentials property.

  3. Open the channel factory.

  4. Get an instance of the channel by invoking the CreateChannel method on the channel factory.

  5. Open the channel.

You can specify the binding and endpoint address in your code or from configuration.

Specifying the Binding and Endpoint Address in Code

The following code example shows how to create an IRequestChannel by specifying the binding and endpoint address in code. The code to create an IOutputChannel is the same except that you must specify an IOutputChannel interface for the ChannelFactory and channel type.

// Create binding -- set binding properties before you open the factory.
OracleEBSBinding binding = new OracleEBSBinding();

// Create address
EndpointAddress address = new EndpointAddress("oracleebs://<oracleebs_instance_name>/");

// Create channel factory from binding and address.
ChannelFactory<IRequestChannel> factory = 
    new ChannelFactory<IRequestChannel>(binding, address);

// Specify credentials. 
factory.Credentials.UserName.UserName = "myuser";
factory.Credentials.UserName.Password = "mypassword";

// Open factory
factory.Open();

// Get channel and open it.
IRequestChannel channel = factory.CreateChannel();
channel.Open();

Specifying the Binding and Endpoint Address in Configuration

The following code example shows how to create a channel factory from a client endpoint specified in configuration.

// Create channel factory from configuration.
ChannelFactory<IRequestChannel> factory =
new ChannelFactory<IRequestChannel>("MyRequestChannel");

// Specify credentials.
factory.Credentials.UserName.UserName = "myuser";
factory.Credentials.UserName.Password = "mypassword";

// Open the factory.
factory.Open();

// Get a channel and open it.
IRequestChannel channel = factory.CreateChannel();
channel.Open();

The Configuration Settings

The following code shows the configuration settings used for the preceding example. The contract for the client endpoint must be "System.ServiceModel.Channels.IRequestChannel" or "System.ServiceModel.Channels.IOutputChannel" depending on the kind of channel shape that you want to create.

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <system.serviceModel>
        <bindings>
            <oracleEBSBinding>
                <binding openTimeout="00:05:00" name="OracleEBSBinding" closeTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" clientCredentialType="Database"
                    inboundOperationType="Polling" metadataPooling="true" statementCachePurge="false"
                    statementCacheSize="10" pollWhileDataFound="false" pollingInterval="30"
                    useOracleConnectionPool="true" minPoolSize="1" maxPoolSize="100"
                    incrPoolSize="5" decrPoolSize="1" connectionLifetime="0" acceptCredentialsInUri="false"
                    useAmbientTransaction="true" notifyOnListenerStart="true"
                    notificationPort="-1" dataFetchSize="65536" longDatatypeColumnSize="0"
                    skipNilNodes="true" maxOutputAssociativeArrayElements="32"
                    enableSafeTyping="false" insertBatchSize="20" useSchemaInNameSpace="true"
                    enableBizTalkCompatibilityMode="true" enablePerformanceCounters="false">
                    <mlsSettings language="" dateFormat="" dateLanguage="" numericCharacters=""
                        sort="" territory="" comparison="" currency="" dualCurrency=""
                        iSOCurrency="" calendar="" lengthSemantics="" nCharConversionException="true"
                        timeStampFormat="" timeStampTZFormat="" timeZone="" />
                </binding>
            </oracleEBSBinding>
        </bindings>
        <client>
            <endpoint address="oracleebs://oracle_ebs_instance/" binding="oracleEBSBinding"
                bindingConfiguration="OracleEBSBinding" contract="System.ServiceModel.Channels.IRequestChannel"
                name="MyRequestChannel" />
        </client>
    </system.serviceModel>
</configuration>

Creating Inbound (Service) Channels

You configure the Oracle E-Business adapter to poll the Oracle database tables and views by setting binding properties on an instance of OracleEBSBinding. You then use this binding to build a channel listener from which you can get an IInputChannel channel to receive inbound operations from the adapter.

To create and open an IInputChannel to receive messages for inbound operations
  1. Create an instance of OracleEBSBinding.

  2. Set the binding properties required for the inbound operation. For example, for a polling operation, at a minimum you must set the InboundOperationType, PolledDataAvailableStatement, PollingAction, and the PollingInput binding properties to configure the Oracle E-Business adapter to poll the Oracle database.

  3. Create a binding parameter collection using the BindingParameterCollection class and set the credentials.

  4. Create a channel listener by invoking BuildChannelListener<IInputChannel> method on the OracleEBSBinding. You specify the Oracle connection URI as one of the parameters to this method.

  5. Open the listener.

  6. Get an IInputChannel channel by invoking the AcceptChannel method on listener.

  7. Open the channel.

The following code shows how to create a channel listener and get an IInputChannel to receive messages for inbound operations from the adapter.

Dd788479.Important(en-US,BTS.10).gifImportant
The Oracle E-Business adapter only supports one-way receive. So, you must use IInputChannel to receive messages for inbound operations from Oracle E-Business Suite.

// Create a binding: specify the InboundOperationType, the PolledDataAvailableStatement, the PollingAction, and 
// the PollingInput binding properties.
OracleEBSBinding binding = new OracleEBSBinding();
binding.InboundOperationType = InboundOperation.Polling;
binding.PolledDataAvailableStatement = "SELECT COUNT (*) FROM MS_SAMPLE_EMPLOYEE";
binding.PollingAction = "InterfaceTables/Poll/FND/APPS/MS_SAMPLE_EMPLOYEE";
binding.PollingInput = "SELECT * FROM MS_SAMPLE_EMPLOYEE FOR UPDATE";

// Create a binding parameter collection and set the credentials
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = "myuser";
credentials.UserName.Password = "mypassword";

BindingParameterCollection bindingParams = new BindingParameterCollection();
bindingParams.Add(credentials);

// Get a listener from the binding and open it.
Uri connectionUri = new Uri("oracleebs://oracle_ebs_instance/");
IChannelListener<IInputChannel> listener = binding.BuildChannelListener<IInputChannel>(connectionUri, bindingParams);
listener.Open();

// Get a channel from the listener and open it.
IInputChannel channel = listener.AcceptChannel();
channel.Open();

Show:
© 2014 Microsoft