Breadcrumbs

REST Service Reference


Tagged Values


<<E2ERESTService>>

Stereotype <<E2ERESTService>> is used in the component diagram to mark a service as REST service.

Error rendering macro 'multiexcerpt' : Page loading failed


<<E2ERESTPortType>>

Stereotype <<E2ERESTPortType>> is used on a class to mark it as REST port type, the root element of a REST service structure.

Error rendering macro 'multiexcerpt' : Page loading failed

For more information on REST error classes, see REST Service Reference#<<RESTError>>.


<<RESTResource>>

Stereotype <<RESTResource>> is used on a class to mark it as REST resource, part of a REST service structure.

Error rendering macro 'multiexcerpt' : Page loading failed


<<REST>>

Stereotype <<REST>> is used on a <<RESTResource>> class method to mark it as REST method, part of a REST service structure.

Error rendering macro 'multiexcerpt' : Page loading failed

If the method name is one of GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS (with optional trailing '/'), it will be invoked automatically on its parent resource when an corresponding request is received.


Refer (25.3) Implementing REST Methods to for more details and some examples.

Error rendering macro 'multiexcerpt' : Page loading failed


<<RESTParameter>>

Stereotype <<RESTParameter>> is used on a <<REST>> method parameter to mark it as REST parameter. Refer to REST Parameters to for more details and some examples.

Error rendering macro 'multiexcerpt' : Page loading failed


<<RESTOperationTag>>

With <<RESTOperationTag>> you can group your REST methods. Refer to Tagging REST Operations for more details.

Error rendering macro 'multiexcerpt' : Page loading failed


<<RESTError>>


Error rendering macro 'multiexcerpt' : Page loading failed


<<RESTResponseDefinition>>


Error rendering macro 'multiexcerpt' : Page loading failed



<<RESTAlias>>


There were errors rendering macro:

  • An unknown error occurred.


REST Content Types

The Bridge handles content types as follows:


  • If the Content-Type header is set, the Bridge will assume that the request is of that type. All other request will be rejected (HTTP error code 406).

  • If no Content-Type header is set, but the Accept header is, the Bridge will deduce the request type from it. All other request will be rejected (HTTP error code 406).
    To determine the format, the Bridge will take into account the quality factor and the order of the accept headers list.

  • In absence of both headers, the Bridge will assume JSON. All other request will be rejected (HTTP error code 415).

The full matching is done in a "best effort" manner. Given the type format <type>/<subtype>[+<suffix>][; paramName=paramValue]*, the Bridge first disregards the type and parameters. Then it checks, if the subtype is JSON or XML. If the subtype doesn't match with the supported types, it tries the suffix.


REST Adapter Parameters


There were errors rendering macro:

  • An unknown error occurred.


REST Utility Functions


Access to HTTP request and response objects is provided through global methods: getRestHttpRequest()and getRestHttpResponse().

Function

Parameter

Return Value

Description

Example

getRestHttpRequest()

none

object of type Request

Returns the request details as provided by the HTTP call. Changing the request object will not have any effects.

local request = getRestHttpRequest();

getRestHttpResponse()

none

object of type Response

Set the response details to return them to the caller.

local response = getRestHttpResponse();


Error rendering macro 'multiexcerpt' : Page loading failed



REST Parameter Types


Request

Attribute

Type

Description

Values/Example

method

HTTPMethod

HTTP method used in call.

GET

headers

Array of HeaderField

DeprecatedThis attribute is deprecated as of Runtime 2020.11. Please use httpHeaderMap (see below) for new implementations as its implementation complies to the HTTP specification.


All HTTP request header fields as an array of HeaderField classes containing name/value pairs. The header fields contain the standard HTTP headers as well as header parameters, if provided.



queryString

String

Query string, if provided with the call.

status=in%20progress

queryParameters

Array of Parameter

All query parameters as an array of Parameter classes containing name/value pairs.


body

Blob

Body of the HTTP request.


path

String

Path to the REST resource.

/support/supportcases/

pathParameters

Map

All REST parameters as a map.


httpHeaderMap

Map of Entry

Runtime 2020.11 Header information as a map. The map contains arrays of header value strings whereas the header name is the key of the map.

  • Header names are lowercase and treated case insensitive.

  • Multiple headers with the same name are treated as arrays.

Refer to (25.3) HTTP Header Support for more information on the standard xUML HTTP headers.


Response

Attribute

Type

Description

Values/Example

headers

Array of HeaderField

All HTTP response header fields as an array of HeaderField classes containing name/value pairs.


statusCode

Integer

The resulting HTTP status code. If not set explicitly using this object, the service returns 200 if no exception occurred, or 500 otherwise.

404

errorObject

Any

Object of the type defined with stereotype <<RESTError>>.


RequestOptions


Error rendering macro 'multiexcerpt' : Page loading failed


AdapterResponse


Error rendering macro 'multiexcerpt' : Page loading failed


Request and Response Types

REST Type

Attribute

Type

Description

Values/Example

Authentication

username

String

Username.


password

String

Password.


Certificate

file

String

Certificate file.


type

String



ComposerOptions

keepNulls

Boolean

Keep NULL values during JSON composing.


Entry

key

String

Key of the map entry.


value

Array of Any

List of values of the map entry. The dynamic type for httpHeaderMap is String.


HTTPMethod


enumeration

List of all valid HTTP methods

DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT

HeaderField

name

String

Name of the header field.


value

String

Value of the header field.


Option

name

String

Name of the option.


value

String

Value of the option.


Parameter

name

String

Name of the parameter.


value

String

Value of the Parameter.


Proxy

url

String

URL.

A valid URL.

type

String



authentication

Authentication

See above.


SSL

verifyPeer

String



verifyHost

String



caInfo

String



certificate

Certificate

See above.


key

Key





Related Pages: