Home > Class Reference > ENSLIB namespace > EnsLib.HTTP.GenericService


class EnsLib.HTTP.GenericService extends EnsLib.HTTP.Service

Generic HTTP Service based BusinessService class. Can use an HTTP InboundAdapter listener, or the standard CSP Service mechanism, or both. In order for the CSP mechanism to work, HTTP Services using this class must be configured with the invoking URL including ?CfgItem= giving the config item name. (Configured Services exposed using the HTTP Inbound Adapter may also be invoked with this URL parameter but because each configured Inbound Adapter listens on its own TCP/IP port this parameter is just a safety check for them.)


Parameters Properties Methods Queries Indices ForeignKeys Triggers
3 7 8


This is a Business Service class.

The associated Adapter class is EnsLib.HTTP.InboundAdapter.

%AlertStartTime %ConfigName %ConfigQueueName
%ExcludeResponseHttpHeaders %LastActionTime %LastHandledTime
%LastReportedError %OutsideCreated %PreserveSession
%ProcessInputCalled %QuitTask %RequestHeader
%SessionId %SuperSession %SuperSessionCreatedBeforeSession
%WaitForNextCallInterval %WarnedLatest %isShadow
Adapter AlertGracePeriod AlertGroups
AlertOnError ArchiveIO BusinessPartner
CSPNoCharSetConvert EnableStandardRequests GenerateSuperSessionID
IOLogEntry InactivityTimeout KeepCSPPartition
OneWay PersistInProcData SearchTableClass
TargetConfigName ThrottleDelay Validation
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OnClose %OnNew
%OriginalNamespace %PackageName %RemoveFromSaveSet %SerializeObject
%SetModified %SuperSessionSet %ValidateObject AdapterName
AssignOneSetting CloseIOLogEntry ConvertParameter Decrypt
Encrypt EnumerateSettingsClose EnumerateSettingsExecute EnumerateSettingsFetch
EscapeHTML EscapeURL ForceSessionId GenerateSuperSession
GetDeferredResponseToken GetProductionSettingValue GetProductionSettings GetPropertyConnections
GetSettings GetShadowInstance HyperEventCall HyperEventHead
Include InsertHiddenField InsertHiddenFields IsPrivate
Link NewIOLogEntry OnAdapterHTTPResponse OnError
OnErrorStream OnGenerateSuperSession OnGetConnections OnHTTPHeader
OnInit OnKeepalive OnMonitor OnPageError
OnPostHyperEvent OnPreHTTP OnPreHyperEvent OnProcessInput
OnProductionStart OnProductionStop OnResolveDocType OnTearDown
OnValidate Page PopulateSuperSession QueueName
QuoteJS RewriteURL SaveIOLogEntry SendAlert
SendDeferredResponse SendRequestAsync SendRequestSync ShowError
StartTimer StopTimer ThrowError UnescapeHTML
UnescapeURL findDataNotInQuery resolveAndIndex resolveDocType
restoreFormEncoded restoreMultipart


parameter DOCCLASS = "EnsLib.HTTP.GenericMessage";
Set this to remove CSP inserted stream attributes (e.g. FileName, MimeSection) Need these removed for generic.
parameter SETTINGS = "TargetConfigName:Basic:selector?multiSelect=0&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId},PersistInProcData:Additional,KeepCSPPartition:Additional,CSPNoCharSetConvert:Additional";
List of properties can be set as settings in the configuration file format is a comma separated list of property names


property %ExcludeResponseHttpHeaders as %String(MAXLEN="");
Comma separated list of response HTTP Headers from the external systems not to be passed back to the requesting service. The values are case-insensitive. The appropriate Content-Length will be used and ought not be specified here.
property KeepCSPPartition as %Boolean [ InitialExpression = 1 ];
When calling the service through the CSP WebServer (Standard Request) and the target of the service is a business operation invoked InProc then it is possible to attempt to maintain connection to the external system defined in the operation in between messages by setting this to true.
There is still the possibility that the external system will close the connection.
The default is On.
property OneWay as %Boolean;
No response stream expected
property PersistInProcData as %Boolean [ InitialExpression = 1 ];
Persist data to operations with invocation InProc that are called Synchronously.
The default is On.
This setting is only used if calling an operation with invocation InProc.
If this setting is off then no message headers will be created and message bodies will not be saved.
If this setting is off there will be no trace in the message viewer.
If this setting is off there will be no retry attempts by the operation - only one attempt will be made.
property SearchTableClass as %String;
Store a set of searchable properties associated with each XML Document processed.
These records will be stored in the named SearchTable class, if any.
property TargetConfigName as Ens.DataType.ConfigName;
Configuration item to which to send messages
property Validation as %String;
Specifies types of Validation to perform. Set to non-empty to invoke OnValidate() in your subclass. You may add it to SETTINGS in your subclass if you want to distinguish several types of validation.


method OnAdapterHTTPResponse(ByRef pStatus As %Status, ByRef pHTTPResponseStatus As %String, ByRef pBodyLen As %Integer, ByRef pResponseBodyStream As %Stream.Object, ByRef pMainResponseHeader As %String, ByRef pHeaderExtra As %String)
Callback for allowing Service to override and control construction of the HTTP response if invoked via the SOAP Inbound Adapter Split www-authenticate HTTP header and add proxy-support header if needed
method OnInit() as %Status
This user callback method is called via initConfig() from %OnNew() or in the case of SOAP Services from OnPreSOAP()
method OnProcessInput(pRequestBody As %CharacterStream, pResponseBody As %CharacterStream, ByRef pAction As %String) as %Status
Override this method to process incoming data. Do not call SendRequestSync/Async() from outside this method (e.g. in a SOAP Service or a CSP page).
method OnResolveDocType(pMsg As EnsLib.HTTP.GenericMessage, ByRef pDocType As %String, ByRef pHeaderDocType As %String) as %Boolean
Override this method to implement your own custom method for resolving the DocType of an incoming Message Returning nonzero means you are overriding the framework's standard DocType resolution.
method OnTearDown() as %Status
This user callback method is called from %OnClose()
method OnValidate(pMsg As EnsLib.HTTP.GenericMessage, pValSpec As %String, Output pStatus As %Status) as %Boolean
Override this method to implement your own custom method for validating an incoming Document Return non-zero to prevent default validation of the message (if any);
method resolveAndIndex(pMsg As EnsLib.HTTP.GenericMessage) as %Status
Accept only specified document names; resolve DocType and perform requested validation if any
method resolveDocType(pMsg As EnsLib.HTTP.GenericMessage, Output pHeaderDocType As %String) as %String
Return the DocType that this service will assign to this message's body document