Code Sample Example for Creating a Property Set

The following is an example of the Siebel eScript code that you must write to create the property set described in Business Scenario for the Use of Business Services:

x = TheApplication.InvokeMethod("WebForm", inputs, outputs);
var svc; // variable to contain the handle to the Service
var inputs; // variable to contain the XML input
var outputs; // variable to contain the output property set
svc = TheApplication().GetService("EAI XML Read from File");
   inputs = TheApplication().ReadEAIMsg("webform.xml"); 
   outputs = TheApplication().NewPropertySet(); 
svc.InvokeMethod("Read XML Hierarchy", inputs, outputs); 

The following functions could be called from the preceding code. You attach the function to a business service in Siebel Tools:

Note: You cannot pass a business object as an argument to a business service method.
Function Service_PreInvokeMethod(MethodName, inputs, outputs) 
   {
   if (MethodName=="GetWebContact") 
   {
      fname = inputs.GetProperty("<First Name>"); 
      lname = inputs.GetProperty("<Last Name>");
      outputs.SetProperty("First Name",fname); 
      outputs.SetProperty("Last Name", lname);
   return(CancelOperation);
   }
return(ContinueOperation); 
}
Function Service_PreCanInvokeMethod(MethodName, CanInvoke) 

{
   if (MethodName="GetWebContact") 
   {
      CanInvoke ="TRUE"; 
      return (CancelOperation);
   }
   else
   {
   return (ContinueOperation);
   }
}