次の方法で共有


Oracle E-Business Suite のクライアント バインドを構成する

WCF クライアント クラスを生成したら、WCF クライアント (インスタンス) を作成し、そのメソッドを呼び出して Oracle E-Business アダプターを使用できます。

WCF クライアントを作成するには、エンドポイント アドレスとバインドを指定する必要があります。 エンドポイント アドレスには有効な Oracle E-Business Suite 接続 URI が含まれている必要があり、バインドは Oracle E-Business Suite バインド (OracleEBSBinding) のインスタンスである必要があります。 Oracle E-Business Suite 接続 URI の詳細については、「 Oracle E-Business Suite への接続を作成する」を参照してください。 接続 URI の一部としてユーザー資格情報を指定しないことをお勧めします。 このトピックで説明するように、代わりに WCF クライアントの ClientCredentials プロパティを使用できます。

Oracle E-Business Suite バインドとエンドポイント アドレスは、コードまたは構成ファイルで指定できます。 アダプター サービス参照の追加 Visual Studio プラグインを使用して WCF クライアント クラスを生成すると、プロジェクト用に構成ファイル (app.config) も作成されます。 このファイルには、アダプター サービス参照プラグインを追加して Oracle E-Business Suite に接続したときに指定したバインディング プロパティと接続情報 (資格情報を除く) を反映した構成設定が含まれています。

コードでのバインディングとエンドポイント アドレスの指定

次のコードは、WCF クライアントの ClientCredentials プロパティを使用して、コードでバインディングとエンドポイント アドレスを指定して WCF クライアントを作成する方法を示しています。

//Create an Oracle EBS binding and set the binding properties  
OracleEBSBinding binding = new OracleEBSBinding();  
binding.OracleUserName = "myOracleEBSUser";  
binding.OraclePassword = "myOracleEBSPassword";  
binding.OracleEBSResponsibilityName = "Responsibility";  
binding.OracleEBSOrganizationId = "204";  
  
//Create the client endpoint   
EndpointAddress address = new EndpointAddress("oracleebs://<oracleebs_instance_name>/");  
  
//Create the client and specify the credentials  
ConcurrentPrograms_ARClient client = new ConcurrentPrograms_ARClient(binding,address);  
client.ClientCredentials.UserName.UserName = "myuser";  
client.ClientCredentials.UserName.Password = "mypassword";  
  
//Open the client  
client.Open();  

構成ファイルでのバインディングとエンドポイント アドレスの指定

次のコードは、app.config ファイルでバインディングとエンドポイント アドレスを指定して WCF クライアントを作成する方法を示しています。

//Create the client by specifying the endpoint name in the app.config. In this case, the binding properties  
//must also be specified in the app.config.  
ConcurrentPrograms_ARClient client = new ConcurrentPrograms_ARClient("OracleEBSBinding_ConcurrentPrograms_AR");  
  
//Specify the credentials   
client.ClientCredentials.UserName.UserName = "myuser";  
client.ClientCredentials.UserName.Password = "mypassword";  
  
client.Open();  

次の XML は、アダプター サービス参照プラグインの追加によって Customer Interface 同時実行プログラム用に作成された構成ファイルを示しています。 このファイルには、前の例で参照したクライアント エンドポイント構成が含まれています。

<?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="32512"  
                    skipNilNodes="true" maxOutputAssociativeArrayElements="32"  
                    enableSafeTyping="false" insertBatchSize="20" useSchemaInNameSpace="true"  
                    enableBizTalkCompatibilityMode="true">  
                    <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://ebs-70-12/" binding="oracleEBSBinding"  
                bindingConfiguration="OracleEBSBinding" contract="ConcurrentPrograms_AR"  
                name="OracleEBSBinding_ConcurrentPrograms_AR" />  
        </client>  
    </system.serviceModel>  
</configuration>  

プロジェクトに複数の WCF クライアントがある場合、構成ファイルに複数のクライアント エンドポイント エントリが定義されます。 各 WCF クライアント エントリには、バインド構成とターゲット Oracle E-Business Suite 成果物に基づいて一意の名前が付けられます。 プロジェクトで WCF クライアントを作成するために複数回接続すると、接続ごとに 1 つずつ、複数のバインド構成エントリが作成されます。 これらのバインド構成エントリには、OracleEBSBinding、OracleEBSBinding1 などの名前が付けられます。 特定の接続中に作成された各クライアント エンドポイント エントリは、その接続中に作成されたバインド エントリを参照します。

参照

WCF サービス モデルを使用して Oracle E-Business Suite アプリケーションを開発する