Bookshelf Home | Contents | Index | PDF |
Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll > Business Services > Business Scenario for the Use of Business ServicesConsider an example of a form on a corporate Web site. Many visitors during the day enter their personal data into the fields on the Web form. The field names represent arguments, whereas the personal data represent data. When the visitor clicks Submit on the form, the form's CGI script formats and sends the data by way of the HTTP transport protocol to the corporate Web server. The CGI script can be written in JavaScript, Perl, or another scripting language. The CGI script may have extracted the field names and created XML elements from them to resemble the following XML tags. First Name = <FirstName></FirstName> Last Name = <LastName></LastName> The CGI script may then have wrapped each data item inside the XML tags: To insert the preceding data into the Siebel Database as a Contact, your script calls a business service that formats the XML input into a property set structure that the Siebel application recognizes. Code Sample Example for Creating a PropertyAn example of the code you need to write to create the property set may look something like this: 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);
|
Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll |