Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [EnsLib] >  [REST] >  [Service]
Private  Storage   

abstract class EnsLib.REST.Service extends EnsLib.HTTP.Service, %CSP.REST, Ens.Util.JSON

REST Service 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.)

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
3 6


Summary

This is a Business Service class.

The associated Adapter class is EnsLib.HTTP.InboundAdapter.

Properties
%AlertStartTime %ConfigName %ConfigQueueName
%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 ThrottleDelay

Methods
%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 AcceptsContentType
AccessCheck AdapterName AssignOneSetting CloseIOLogEntry
ConvertParameter Decrypt DispatchRequest DrawCSS3STYLE
DrawHEAD DrawSTHEAD DrawSTTitle DrawSTYLE
DrawTitle DrawTitleSection Encrypt EnumerateSettingsClose
EnumerateSettingsExecute EnumerateSettingsFetch Error EscapeHTML
EscapeURL ForceSessionId GenerateSuperSession GetAuthChallenge
GetDeferredResponseToken GetMsgHdrRequestKey GetProductionSettingValue GetProductionSettings
GetPropertyConnections GetSettings GetShadowInstance Http403
Http404 Http405 Http500 HyperEventCall
HyperEventHead Include InsertHiddenField InsertHiddenFields
IsPrivate JSONStreamToObject JSONStreamToObjectArray Link
Login NewIOLogEntry ObjectToJSONStream OnAdapterHTTPResponse
OnError OnErrorSetup OnErrorStream OnGenerateSuperSession
OnGetConnections OnHTTPHeader OnHandleCorsRequest OnHandleOptionsRequest
OnInit OnKeepalive OnLoginPage OnMonitor
OnPageError OnPostHyperEvent OnPreDispatch OnPreHTTP
OnPreHyperEvent OnProcessInput OnProductionStart OnProductionStop
OnSecurityTokenPage OnTearDown Page PopulateSuperSession
QueueName QuoteJS ReportHttpStatusCode RewriteURL
SaveIOLogEntry SendAlert SendDeferredResponse SendRequestAsync
SendRequestSync SetResponseHeaderIfEmpty ShowError StartTimer
StatusToJSON StatusToProxyObject StopTimer SupportedVerbs
ThrowError UnescapeHTML UnescapeURL altJSONStreamToObject
altJSONStreamToObjectArray findDataNotInQuery restoreFormEncoded restoreMultipart


Parameters

• parameter ADAPTER = "EnsLib.HTTP.InboundAdapter";
Name of the adapter class - override this to "" if you want to use only the regular HTTP mechanism and not the custom-port HTTP InboundAdapter.
• parameter EnsServicePrefix;
This prefix will be removed from the beginning of the actual URL before matching it against the UrlMap. If this prefix begins with '^' then the CSP Application will also be removed from the beginning of the URL if this service is being invoked via the CSP gateway. If this prefix begins with '|' then the Config Name for this service will be removed from the beginning of the URL, as well as the CSP Application if this service is being invoked via the CSP gateway.
• parameter PREFIXCASESENSITIVE = 0;

Methods

• classmethod Http405(pSupportedVerbs As %String = "") as %Status
Issue a '405' error ( user can override)
• method OnProcessInput(pInput As %Library.AbstractStream, Output pOutput As %Stream.Object = $$$NULLOREF) as %Status
Override this method in your subclass if you want to handle dispatching yourself. This implementation paraphrases the %CSP.REST:DispatchRequest() implementation with modifications to support the input and output streams used by the HTTP Adapter.
• final classmethod Page(skipheader As %Boolean = 1) as %Status
This method matches the request and method and calls the dispatcher
• classmethod ReportHttpStatusCode(pHttpStatus, pSC As %Status = $$$OK) as %Status
Issue an HTTP error


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.