Skip to main content

Using the "Web Engine HTTP TXN" Business Service to Access Cookies, Querystring Parameters, Form Field Parameters, HTTP Headers, and Server Variables (Doc ID 476473.1)

APPLIES TO:

Siebel Tools - Version 8.0 [20405] to 17.0 [IP2017] [Release V8 to V17]
Siebel Tools - Version 17.0 [IP2017] and later
All Platforms
PURPOSE
HTTP provides several means to allow Web Servers to obtain information from the browser.  The most familiar example is that when a user enters data into a form on a Web page, the data is sent to the Web Server, which can access the value of each form field.  This example illustrates sending form field parameters to the Web server with a POST method.  In general, a browser can send Cookies, headers, querystring parameters, as well as form field parameters to the Web server.  Web servers can also respond back to the browser with Cookies and custom headers.  The "Web Engine HTTP TXN" business service enables Siebel eBusiness Applications to retrieve or set Cookies, headers, and querystring and form field parameters.

SCOPE

This document is informational and intended for any user.


Note that there are complications in attempting to use this Business Service from a Workflow.

1) For a Business Service that accepts/returns hierarchical arguments, the argument name is used to identify the child property set to pass/store. This is problematic in workflow, because it places a restriction on the argument name across Busines Service. For example, if Business Service BS1 returns a property set of type A, and Business Service BS2 accepts a property set of type B, you cannot pass the output of BS1 directly into BS2 in workflow, without adding an intermediately step to alter the type.    (BUG 10448594 - SHOULD BE ABLE TO SPECIFY CHILD TO PASS/STORE IN WORKFLOW")
2) This BS is meant to be run exclusively at a graphical user interface object manager such as call center.  HTTP Headers are not meaningful in a non GUI component such as wfprocmgr.  (BUG 10503454 - "WEB ENGINE HTTP TXN" NOT WORKING WITH "WORKFLOW" )

Both of the above Enhancement Request Bugs were created to address the complications, but the Enhancement Request were both rejected.  It is a fact of life that the Web Engine HTTP TXN" business service should not be used from a workflow using "Workflow Process Manager (Server Request)" and that there may be issues when passing the resulting Property Sets to other WF steps.

If using this BS in a Workflow, rather than calling the BS directly from the WF, you may be able to use the WF to call a custom BS, and then in the custom BS, use scripting to call the "Web Engine HTTP TXN" BS.

DETAILS

The "Web Engine HTTP TXN" business service can be invoked by scripts.  The inbound HTTP request to the Siebel Web Engine (SWE) is parsed and the business service returns property sets containing Cookies, headers, or parameters.  In addition, server variables, which are not a part of the HTTP request header, can also be retrieved.  The business service can also set a custom Cookie or header in the HTTP response header generated by the SWE.  It gives complete control over the request header received and response header sent by the SWE.

When using this vanilla BS you may get unexpected results. That is because it will display data about the request that reached SWSE. In complex environments, that request may not be the request that originally left the end user´s browser so.. its not a reliable thing and I would not advice the customer to build anything on top of it.

Also note that this BS is not supported to be used in Application_Load event

The following is an application scenario:

A customer visits a Portal site and decides to purchase some items.  Once all selected items are in the shopping cart, the Portal Server communicates with Siebel using the XML Web Interface via HTTP and sends the order items as Cookies.  The "Web Engine HTTP TXN" business service is invoked from a business component server script, which retrieves the Cookie values and creates an Order with the selected Order Items.  The business service also sets a new custom header to inform the Portal Server that the Order has been created in the Siebel application.  The Order information in the Siebel application is also returned to the Portal Server in XML. 

This application scenario demonstrates the "Web Engine HTTP TXN" business service working together with the XML Web Interface to enable integration with Web Application Servers (.NET or J2EE). 

eScript Sample Code:


var oBS = TheApplication().GetService("Web Engine HTTP TXN") ;
var psInputs = TheApplication().NewPropertySet();
var psOutputs = TheApplication().NewPropertySet();
var psCookie = TheApplication().NewPropertySet();
var sCookieVal;
// ------------------
// Read All Request Cookies
// ------------------
oBS.InvokeMethod("GetAllRequestCookies", psInputs, psOutputs);
for (var i = 0; i < psOutputs.GetChildCount(); i++)
   {
   psCookie = psOutputs.GetChild(i);
   if (psCookie.GetType() == "Login")
      {
      sCookieVal = psCookie.GetValue();
      break;
      }
   }

psInputs.Reset();
psOutputs.Reset();
psCookie.Reset();

// ------------------
// Create A Response Cookie
// ------------------
psCookie.SetType("Login");
psCookie.SetValue("1");
psCookie.SetProperty("Max-Age", "430000"); //5 Days (Thin Client)
psInputs.AddChild(psCookie);
oBS.InvokeMethod("SetResponseCookies", psInputs, psOutputs);

psInputs.Reset();
psOutputs.Reset();
psCookie.Reset();

// ------------------
// Retrieve A Request Cookie
// ------------------
psInputs.SetProperty ("Login", "");
oBS.InvokeMethod("GetRequestCookies", psInputs, psOutputs);
psCookie = psOutputs.GetChild(0);
sCookieVal = psCookie.GetValue();
// ------------------
// Update A Retrieved Response Cookie
// ------------------
psCookie.SetValue(ToInteger(sCookieVal) + 1);
psCookie.SetProperty("Max-Age", "430000"); //5 Days (Thin Client)
psInputs.AddChild(psCookie);
oBS.InvokeMethod("SetResponseCookies", psInputs, psOutputs);

psOutputs = null;
psInputs = null;
oBS = null;
psCookie = null;

Refer to the following API for specific methods supported by this Business Service.

"Web Engine HTTP TXN" Business Service API:

Method
Description
Parameters
GetAllRequestCookiesRetrieves all request cookies.InputArguments:
Ignored
OutputArguments:
Property Set hierarchy.  Each cookie is a child Property Set with the TYPE property set to the cookie name.
GetAllRequestHeadersRetrieves all request headers.InputArguments:
Ignored
OutputArguments:
Property Set containing the HTTP Header name/value pairs.
GetAllRequestParametersRetrieves all request parameters.InputArguments:
Ignored
OutputArguments:
Property Set containing the HTTP Parameter name/value pairs.
GetAllResponseCookiesRetrieves all response cookies.InputArguments:
Ignored
OutputArguments:
Property Set hierarchy.  Each cookie is a child Property Set with the TYPE property set to the cookie name.
GetAllResponseHeadersRetrieves all response headers.InputArguments:
Ignored
OutputArguments:
Property Set containing the HTTP Header name/value pairs.
GetAllServerVariablesRetrieves all server variables.InputArguments:
Ignored
OutputArguments:
Property Set containing the Server Variable name/value pairs.
GetClientCertificateRetrieves the client certificate info.InputArguments:
Ignored
OutputArguments:
Property Set containing certificate name/value pairs.  Currently only returns CN property of the certificate.
GetRequestCookiesRetrieves the request cookies named in InputArgumentsInputArguments:
Property Set containing the cookie names to retrieve.
OutputArguments:
Property Set hierarchy.  Each cookie is a child Property Set with the TYPE property set to the cookie name.
GetRequestHeadersRetrieves the request headers named in InputArgumentsInputArguments:
Property Set containing the header names to retrieve.
OutputArguments:
Property Set containing the HTTP Header name/value pairs.
GetRequestInfoRetrieves the request Web Session, Headers, Cookies, Parameters and Client Certificate information in one call.InputArguments:
Ignored
OutputArguments:
Property Set hierarchy.  Each section is a child Property Set with the TYPE property set to: "Headers","Cookies", "Parameters" or "ClientCertificate".  The Web Session information is simply stored as properties of OutputArguments.
GetRequestParametersRetrieves the request parameters named in InputArgumentsInputArguments:
Property Set containing the parameter names to retrieve.
OutputArguments:
Property Set containing the HTTP Parameter name/value pairs.
GetResponseCookiesRetrieves the response cookies named in InputArgumentsInputArguments:
Property Set containing the cookie names to retrieve.
OutputArguments:
Property Set hierarchy.  Each cookie is a child Property Set with the TYPE property set to the cookie name.
GetResponseHeadersRetrieves the response headers named in InputArgumentsInputArguments:
Property Set containing the header names to retrieve.
OutputArguments:
Property Set containing the HTTP Header name/value pairs.
GetResponseInfoRetrieves the response Headers and Cookies in one call.InputArguments:
Ignored
OutputArguments:
Property Set hierarchy.  Each section is a child Property Set with the TYPE property set to: "Headers" or "Cookies".  Content Type and Status are simply stored as properties of OutputArguments.
GetServerVariablesRetrieves the server variables named in InputArgumentsInputArguments:
Property Set containing the server variable names to retrieve.
OutputArguments:
Property Set containing the Server Variable name/value pairs.
GetWebSessionInfoRetrieves the client̢۪s web session information.InputArguments:
Ignored
OutputArguments:
Property Set containing the web session name/value pairs:
SessionName: Cookie Name.
SessionId: Web Session ID.
SessionFrom: Value is "URL" or "COOKIE"
SetResponseCookiesSets the response cookies to the values in InputArguments.InputArguments:
Property Set hierarchy.  Each cookie is a child Property Set with the TYPE property set to the cookie name.
OutputArguments:
Ignored
SetResponseHeadersSets the response headers to the values in InputArguments.InputArguments:
Property Set containing the HTTP Header name/value pairs.
OutputArguments:
Ignored
SetResponseInfoSets the response Headers and Cookies in one call.InputArguments:
Property Set hierarchy.  Each section is a child Property Set with the TYPE property set to: "Headers" or "Cookies".  Content Type and Status are simply stored as properties of InputArguments.
OutputArguments:
Ignored


When using this vanilla BS you may get unexpected results. That is because it will display data about the request that reached SWSE. In complex environments, that request may not be the request that originally left the end user´s browser so.. its not a reliable thing and I would not advice the customer to build anything on top of it.

Source:
https://support.oracle.com/ > Doc ID 476473.1

Comments

Popular posts from this blog

How to set Profile Attribute in Siebel Workflow

For setting the Profile Attribute in Siebel Workflow, follow below steps: Add Business Service box in workflow. Open Business Service properties. Set  SessionAccessService in Business Service Name. Set  SetProfileAttr in Method Name. Then click on Business Service and set Input Arguments as below: Against Name argument you will add your profile attribute name and against Value argument you will add value for the new profile attribute, it could be from Process Property or Literal.

How to call Popup Applet through Server Script in Siebel

Background: Based on the requirements you need to show data or reports on a popup applet. You can invoke popup applet using workflow (below business service will be used in business service step), applet server script or browser script and using vanilla method and setting field user properties. Procedure: Below is the script for calling popup applet through server script: if (MethodName == "MethodName") { var oServiceAF = TheApplication().GetService("SLM Save List Service"); var inputPropAF = TheApplication().NewPropertySet(); var outputPropAF = TheApplication().NewPropertySet(); inputPropAF.SetProperty("Applet Name","ABC Popup Applet"); inputPropAF.SetProperty("Applet Mode","6"); inputPropAF.SetProperty("Applet Height", "700"); inputPropAF.SetProperty("Applet Width", "700"); oServiceAF.InvokeMethod("LoadPopupApplet", inputPropAF, outputPropAF) return (CancelOperati...

How to create and publish Inbound Web Service in Siebel based on Workflow

Inbound Web Services: The Inbound Web Service allows an external system to call a Siebel published Web Service. You can publish a business service or a business process as a Web Service and generate a Web Service Definition Language (WSDL) file that an external system can import. The Inbound Web Services can only be published from Siebel C using SOAP-RPC binding. Source: Oracle Docs What Is The Difference Between Web Services and APIs? An API is an interface that allows you to build on the data and functionality of another application, while a web service is a network-based resource that fulfills a specific task. Yes, there’s overlap between the two: all web services are APIs, but not all APIs are web services. Both web services and APIs are — at their core — very useful and very much used today. However, it’s the web services associated with SOAP and/or Service Oriented Architecture which are falling out of favor. Source: NordicApis Process: Prepare the workflow which will serve as Si...