Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll > Business Services >

About Accessing a Business Service Using Siebel eScript or Siebel VB


In addition to accessing a business service through a workflow process, you can use Siebel VB or eScript to call a business service. The following Siebel eScript code calls the business service EAI XML Read from File to read an XML file and produce a property set as an output. The output property set is used by EAI Siebel Adapter to insert a new account into the Siebel application:

var svcReadFile = TheApplication().GetService("EAI XML Read from File") ;

var svcSaveData = TheApplication().GetService("EAI Siebel Adapter");

var child = TheApplication().NewPropertySet();

var psInputs = TheApplication().NewPropertySet();

var psOutputs = TheApplication().NewPropertySet();

var psOutputs2 = TheApplication().NewPropertySet();

var svcSaveData = TheApplication().GetService("EAI Siebel Adapter");

psInputs.SetProperty("FileName", "c:\\NewAccount.xml");

psOutputs.SetType "SiebelMessage";

psOutputs.SetProperty "IntObjectName","Sample Account";

psOutputs.SetProperty "MessageId", "";

psOutputs.SetProperty "MessageType", "Integration Object";

svcReadFile.InvokeMethod("ReadEAIMsg",psInputs, psOutputs);

svcSaveData.InvokeMethod("Upsert",psOutputs,psOutputs2);

The following Siebel VB sample code shows how to call the EAI File Transport business service to read an XML file. It also shows how to use the XML Converter business service to produce a property set.

Set Inp = TheApplication.NewPropertySet

Inp.SetProperty "FileName", "c:\test.xml"

Inp.SetProperty "DispatchService", "XML Converter"

Inp.SetProperty "DispatchMethod" , "XMLToPropSet"

Set svc = theApplication.GetService("EAI File Transport")

Set XMLOutputs = theApplication.NewPropertySet

svc.InvokeMethod "ReceiveDispatch", Inp, XMLOutputs

TheApplication.RaiseErrorText Cstr(XMLOutputs.GetChildCount)

Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll