Siebel Portal Framework Guide > Web Engine HTTP TXN Business Service >
Example of Using Web Engine HTTP TXN Business Service
To invoke each method of the Web Engine HTTP TXN Business Service and write the results to a text file, use the following two procedures:
Adding Sample Code for Displaying Results of Using the Business Service
The following procedure shows how to add sample code for displaying results of the Web Engine HTTP TXN Business Service. To add sample code for displaying results of Web Engine HTTP TXN Business Service
- In Oracle's Siebel Tools, navigate to the desired Applet object, in the Object Explorer.
- Lock the project, if required.
- Right click and select the Edit Server Script option.
- Add the following three functions, individually to the declarations section:
- WebApplet_OutputChildPropertySets
- WebApplet_OutputProperties
- WebApplet_OutputPropertySet
Sample Code Functions
Sample code for the WebApplet_OutputChildPropertySets Function: function WebApplet_OutputChildPropertySets(oPropertySet, nLevel, fp) { var oChildPropSet; var nChild = 0;
Clib.fputs('-------------------------------------\n',fp); Clib.fputs('CHILD PROPERTY SETS\n',fp); Clib.fputs('-------------------------------------\n',fp);
if ( oPropertySet.GetChildCount() == 0 ) {
Clib.fputs('(NONE)\n',fp); } else { for ( nChild = 0; ( nChild <= oPropertySet.GetChildCount() - 1 ) ; nChild++ ) { oChildPropSet = oPropertySet.GetChild(nChild); WebApplet_OutputPropertySet (oChildPropSet, nLevel+1, fp); } } }
Sample code for the WebApplet_OutputProperties Function: function WebApplet_OutputProperties(oPropertySet, nLevel , fp ) { var strName; var strValue;
Clib.fputs('-------------------------------------\n',fp); Clib.fputs('PROPERTIES\n',fp); Clib.fputs('-------------------------------------\n',fp);
if (oPropertySet.GetPropertyCount() == 0 ) { Clib.fputs('(NONE)\n',fp); } else { strName = oPropertySet.GetFirstProperty(); while ( strName != '') { Clib.fputs(strName + ' : ' + oPropertySet.GetProperty(strName) + '\n' ,fp); strName = oPropertySet.GetNextProperty(); } } }
Sample code for the WebApplet_OutputPropertySet Function: function WebApplet_OutputPropertySet(oPropertySet, nLevel, fp ) { Clib.fputs('\n',fp); Clib.fputs('-------------------------------------\n',fp); Clib.fputs('START' + ' ',fp); Clib.fputs('LEVEL : ' + nLevel + '\n', fp); Clib.fputs('-------------------------------------\n',fp);
Clib.fputs('TYPE : ' + oPropertySet.GetType() + '\n',fp); Clib.fputs('VALUE : ' + oPropertySet.GetValue() + '\n',fp);
WebApplet_OutputProperties(oPropertySet, nLevel, fp); WebApplet_OutputChildPropertySets(oPropertySet, nLevel, fp);
Clib.fputs('-------------------------------------\n',fp); Clib.fputs('END' + ' ',fp); Clib.fputs('LEVEL : ' + nLevel + '\n',fp); Clib.fputs('-------------------------------------\n',fp); }
Adding Sample Code for Invoking Methods of the Business Service
The following procedure shows how to add sample code for invoking methods of the Web Engine HTTP TXN Business Service. To add sample code for invoking methods of Web Engine HTTP TXN Business Service
- Add the code from Sample Code for Invoking Methods of Web Engine HTTP TXN Business Service to the WebApplet_InvokeMethod event.
- Compile the project.
- Start the Siebel application.
- Navigate to the applet where the server script has been placed.
- Perform an action on the applet that invokes a SWE method (for example, change the record or create a new record).
The code generates a text file in the bin directory where the Siebel application is installed containing results of each method of the Web Engine HTTP TXN Business Service.
Sample Output
The following is an excerpt of the resulting text file. ===================================== WebApplet InvokeMethod event: =====================================
===================================== Method: GetAllRequestCookies =====================================
------------------------------------- START LEVEL : 0 ------------------------------------- TYPE : COOKIES VALUE : ------------------------------------- PROPERTIES ------------------------------------- (NONE) ------------------------------------- CHILD PROPERTY SETS -------------------------------------
------------------------------------- START LEVEL : 1 ------------------------------------- TYPE : SWEUAID VALUE : 1 ------------------------------------- PROPERTIES ------------------------------------- Max-Age : -1 Domain : Path : ------------------------------------- CHILD PROPERTY SETS ------------------------------------- (NONE) ------------------------------------- END LEVEL : 1 ------------------------------------- ------------------------------------- END LEVEL : 0 -------------------------------------
===================================== Method: GetAllRequestHeaders =====================================
------------------------------------- START LEVEL : 0 ------------------------------------- TYPE : HEADERS VALUE : ------------------------------------- PROPERTIES ------------------------------------- HOST : <host computer name> CACHE-CONTROL : no-cache CONNECTION : Keep-Alive COOKIE : SWEUAID=1 USER-AGENT : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461; SV1; .NET CLR 1.1.4322) CONTENT-TYPE : application/x-www-form-urlencoded ACCEPT-ENCODING : deflate CONTENT-LENGTH : 348 ------------------------------------- CHILD PROPERTY SETS ------------------------------------- (NONE) ------------------------------------- END LEVEL : 0 -------------------------------------
===================================== Method: GetAllRequestParameters =====================================
------------------------------------- START LEVEL : 0 ------------------------------------- TYPE : PARAMETERS VALUE : ------------------------------------- PROPERTIES ------------------------------------- SWEActiveView : Account List View SWERowIds : SWEP : SWESP : false SWECmd : InvokeMethod SWEMethod : PositionOnRow SWER : 1 SWEControlClicked : 0 SWEIgnoreCtrlShift : 0 SWEVI : SWEActiveApplet : Account List Applet SWERPC : 1 SWEReqRowId : 1 SWEView : Account List View SWEC : 3 SWERowId : 1-6 SWEShiftClicked : 0 SWETS : 1118939959734 SWEApplet : Account List Applet ------------------------------------- CHILD PROPERTY SETS ------------------------------------- (NONE) ------------------------------------- END LEVEL : 0 -------------------------------------
|