WCF 서비스 모델을 사용하여 Siebel 어댑터로 비즈니스 서비스 메서드 호출
Siebel 비즈니스 서비스의 메서드를 대상으로 하는 WCF 클라이언트를 만들 수 있습니다. 그런 다음 WCF 클라이언트를 사용하여 Siebel 시스템에서 이러한 메서드를 호출할 수 있습니다. Siebel 비즈니스 서비스는 어댑터 서비스 추가 참조 Visual Studio 플러그 인의 Business Services 노드 아래에 표시됩니다. 각 비즈니스 서비스에서 노출하는 메서드는 해당 서비스에 해당하는 노드 아래에 표시됩니다. Siebel 어댑터를 사용하여 WCF 서비스 모델 개요의 단계에 따라 비즈니스 서비스에 대한 WCF 클라이언트를 생성하고 이를 사용하여 서비스의 메서드를 호출할 수 있습니다.
다음 코드는 WCF 클라이언트를 사용하여 TimeStamp 비즈니스 서비스의 Execute 메서드를 호출합니다. Siebel 서버의 현지 시간에 반환되는 타임스탬프는 콘솔에 기록됩니다. 이 예제의 WCF 클라이언트는 어댑터 서비스 참조 추가 플러그 인에 의해 생성된 구성 파일에서 초기화됩니다. 생성된 구성 파일의 예제는 Siebel 시스템에 대한 WCF 클라이언트 구성을 참조하세요.
using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using microsoft.lobservices.siebel._2007._03.BusinessServices.TimeStamp;
namespace Business_Service
{
class Program
{
static void Main(string[] args)
{
BusinessServices_TimeStamp_OperationClient client = null;
try
{
client =
new BusinessServices_TimeStamp_OperationClient("SiebelBinding_BusinessServices_TimeStamp_Operation");
client.ClientCredentials.UserName.UserName = "YourUserName";
client.ClientCredentials.UserName.Password = "YourPassword";
client.Open();
ExecuteResponseRecord er = client.Execute();
Console.WriteLine(er.Time);
Console.WriteLine("\nHit <RETURN> to finish");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
// Close the client.
if (client != null)
{
if (client.State == CommunicationState.Opened)
client.Close();
else
client.Abort();
}
}
}
}
}