Example Transport Invocation Function
This example function invokes the SyncISInvoke transport. Each time an Insert service adds a record to the Contact business component, the function sends the record's first and last names to Integration Server.
1. function BusComp_WriteRecord ()
2. {
3. // When an Insert service adds a record into Siebel, send the
4. // contact's First Name and Last Name to Integration Server.
5.
6. var inpts = TheApplication().NewPropertySet();
7. var otpts = TheApplication().NewPropertySet();
8.
9. inpts.SetProperty("server","localhost:5555");
10. inpts.SetProperty("userName","Administrator");
11. inpts.SetProperty("password","manage");
12. inpts.SetProperty("folderName","myFolder");
13. inpts.SetProperty("useSSL","No");
14. inpts.SetProperty("delimiter",":");
15. inpts.SetProperty("serviceName", "receiveContactInfo");
16.
17. var inputData = TheApplication().NewPropertySet();
18. inputData.SetProperty("Last Name",this.GetFieldValue("Last Name"));
19. inputData.SetProperty("First Name",this.GetFieldValue("First Name"));
20. inpts.AddChild(inputData);
21.
22. var oBS = TheApplication().GetService("EAI webMethods Transports");
23. oBS.InvokeMethod("SyncISInvoke", inpts, otpts);
24.
25. // Retrieve the invocation status, and message.
26. var st = otpts.GetProperty("status");
27. var msg = otpts.GetProperty("message");
28. // Retrieve the property set containing the data returned by the
29. // Integration Server.
30. var data = otpts.GetChild(0);
31.
32. }
In this example, note that:
Line 6 creates the input property set that the function will use to send input data to
Integration Server.
Line 7 creates the output property set that the function will use to receive output data from
Integration Server.
Lines 9-15 define the inputs of the input property set.
Line 17 assigns the input property set as the value of the transport's inputData parameter.
Lines 18-19 pass the first and last names of the new contact to the property set.
Line 20 creates the child property set containing data.
Lines 22-23 invoke the SyncISInvoke transport.
Lines 26-27 retrieve the status and message variables from the output property set. These variables are contained in the parent Siebel property set.
Lines 30 retrieves the child property set from the output property set. The child property set contains the data returned from
Integration Server.