Integration Platform Technologies: Siebel Enterprise Application Integration > Business Services >

About Accessing a Business Service Using Siebel eScript or Siebel VB


In addition to accessing a business service through a workflow, 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 produces a property set as an output. The EAI Siebel Adapter uses the output property set 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 Enterprise Application Integration Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices.