Oracle E-Business Suite를 사용하여 채널 만들기
WCF 채널 모델에서는 Oracle E-Business Suite에서 작업을 호출하고 WCF 채널을 통해 Microsoft BizTalk Adapter for Oracle E-Business Suite와 SOAP 메시지를 교환하여 결과를 받습니다.
IRequestChannel 또는 IOutputChannel을 사용하여 어댑터에 메시지를 보내 작업(아웃바운드 작업)을 호출합니다.
IInputChannel을 통해 인바운드 작업에 대한 메시지를 받습니다.
이 섹션의 topics 인바운드 및 아웃바운드 작업에 사용되는 채널 셰이프를 만들고 구성하는 방법에 대한 정보를 제공합니다.
아웃바운드(클라이언트) 채널 만들기
IRequestChannel 또는 IOutputChannel을 사용하여 Oracle E-Business Suite에서 작업을 호출할 수 있습니다. 두 경우 모두 먼저 적절한 인터페이스를 사용하여 System.ServiceModel.ChannelFactory 를 만듭니다. 그런 다음 팩터리를 사용하여 채널을 만듭니다. 채널을 만든 후에는 이 채널을 사용하여 어댑터에서 작업을 호출할 수 있습니다.
아웃바운드 채널을 만들고 열려면
엔드포인트 및 바인딩을 사용하여 원하는 채널 셰이프에 대한 ChannelFactory instance 만들고 초기화합니다. 엔드포인트는 Oracle E-Business Suite 연결 URI를 지정하고 바인딩은 OracleEBSBinding의 instance.
Credentials 속성을 사용하여 채널 팩터리에 대한 Oracle E-Business Suite 자격 증명 을 제공합니다.
채널 팩터리를 엽니다.
채널 팩터리에서 CreateChannel 메서드를 호출하여 채널의 instance 가져옵니다.
채널을 엽니다.
코드 또는 구성에서 바인딩 및 엔드포인트 주소를 지정할 수 있습니다.
코드에서 바인딩 및 엔드포인트 주소 지정
다음 코드 예제에서는 코드에서 바인딩 및 엔드포인트 주소를 지정하여 IRequestChannel 을 만드는 방법을 보여줍니다. IOutputChannel을 만드는 코드는 ChannelFactory 및 채널 형식에 대한 IOutputChannel 인터페이스를 지정해야 한다는 점을 제외하고 동일합니다.
// 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();
구성에서 바인딩 및 엔드포인트 주소 지정
다음 코드 예제에서는 구성에 지정된 클라이언트 엔드포인트에서 채널 팩터리를 만드는 방법을 보여 줍니다.
// 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();
구성 설정
다음 코드는 이전 예제에 사용된 구성 설정을 보여 있습니다. 클라이언트 엔드포인트에 대한 계약은 만들려는 채널 셰이프의 종류에 따라 "System.ServiceModel.Channels.IRequestChannel" 또는 "System.ServiceModel.Channels.IOutputChannel"이어야 합니다.
<?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>
인바운드(서비스) 채널 만들기
OracleEBSBinding의 instance 바인딩 속성을 설정하여 Oracle 데이터베이스 테이블 및 뷰를 폴링하도록 Oracle E-Business 어댑터를 구성합니다. 그런 다음 이 바인딩을 사용하여 IInputChannel 채널을 가져와 어댑터에서 인바운드 작업을 수신할 수 있는 채널 수신기를 빌드합니다.
인바운드 작업에 대한 메시지를 받을 IInputChannel을 만들고 열려면
OracleEBSBinding의 instance 만듭니다.
인바운드 작업에 필요한 바인딩 속성을 설정합니다. 예를 들어 폴링 작업의 경우 최소한 InboundOperationType, PolledDataAvailableStatement, PollingAction 및 PollingInput 바인딩 속성을 설정하여 Oracle E-Business 어댑터를 구성하여 Oracle 데이터베이스를 폴링해야 합니다.
BindingParameterCollection 클래스를 사용하여 바인딩 매개 변수 컬렉션을 만들고 자격 증명을 설정합니다.
OracleEBSBinding에서 BuildChannelListener<IInputChannel> 메서드를 호출하여 채널 수신기를 만듭니다. Oracle 연결 URI를 이 메서드의 매개 변수 중 하나로 지정합니다.
수신기를 엽니다.
수신기에서 AcceptChannel 메서드를 호출하여 IInputChannel 채널을 가져옵니다.
채널을 엽니다.
다음 코드에서는 채널 수신기를 만들고 IInputChannel 을 가져와 어댑터에서 인바운드 작업에 대한 메시지를 받는 방법을 보여 줍니다.
중요
Oracle E-Business 어댑터는 단방향 수신만 지원합니다. 따라서 IInputChannel 을 사용하여 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();