Codeunit CCS DIS Web Service Adapter
codeunit 5100902 "CCS DIS Web Service Adapter"
Methods
AddRequestHeader
public "CCS DIS Web Service Adapter" AddRequestHeader(Header: Text; Value: Text): None
Adds an custom header to the requests.
Parameters
| Name | Type | Description |
|---|---|---|
| Header | Text |
|
| Value | Text |
Return Value
None
GetResponseContent
public "CCS DIS Web Service Adapter" GetResponseContent(): Text
Returns the response content as plain text.
Return Value
Text
The response content.
GetResponseContent
public "CCS DIS Web Service Adapter" GetResponseContent(var Value: Codeunit "Temp Blob"): None
Returns the response content in a BLOB (stream).
The procedure can be used for binary web request bodies.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Codeunit "Temp Blob" |
The response content. |
Return Value
None
GetResponseContent
public "CCS DIS Web Service Adapter" GetResponseContent(var Value: HttpContent): None
Returns the response as HttpContent.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | HttpContent |
The response message content. |
Return Value
None
GetResponseContent
public "CCS DIS Web Service Adapter" GetResponseContent(var Value: JsonToken): None
Returns the response content as JSON token.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | JsonToken |
The response content. |
Return Value
None
GetResponseContent
public "CCS DIS Web Service Adapter" GetResponseContent(var Value: JsonToken; ThrowError: Boolean): Boolean
Parses the response content into a JSON token.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | JsonToken |
The response. |
| ThrowError | Boolean |
Defines to run an UI error if the JSON parsing failed. |
Return Value
Boolean
Returns true, if the response was parsed into the JSON token.
GetResponseContent
public "CCS DIS Web Service Adapter" GetResponseContent(var Value: XmlDocument): None
Returns the response content as XML document.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | XmlDocument |
The response content. |
Return Value
None
GetResponseError
public "CCS DIS Web Service Adapter" GetResponseError(): Text
Returns a text containing HTTP status code, reasons phrase and the response content.
Return Value
Text
The text to be returned.
GetResponseHeaders
public "CCS DIS Web Service Adapter" GetResponseHeaders(var Value: HttpHeaders): None
Returns the response headers.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | HttpHeaders |
The response message headers. |
Return Value
None
GetResponseMessage
public "CCS DIS Web Service Adapter" GetResponseMessage(var Value: HttpResponseMessage): None
Returns the response message.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | HttpResponseMessage |
The response message. |
Return Value
None
GetUrl
public "CCS DIS Web Service Adapter" GetUrl(): Text
Returns the URL.
Return Value
Text
The URL.
SendRequest
public "CCS DIS Web Service Adapter" SendRequest(): Boolean
Sends the web request.
All parameters must be set before.
Return Value
Boolean
Returns true, if the response status code is success (OK, No Content, ...).
SetAccept
public "CCS DIS Web Service Adapter" SetAccept(Value: Text): Text
Sets the Accept header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
Text
Returns the header value.
SetAuthorization
public "CCS DIS Web Service Adapter" SetAuthorization(Value: Text): Text
Sets the Authorization header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
Text
Returns the header value.
SetBearerToken
public "CCS DIS Web Service Adapter" SetBearerToken(Value: Text): Text
Sets the Bearer Authorization header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
Text
Returns the header value.
SetContentType
public "CCS DIS Web Service Adapter" SetContentType(Value: Text): None
Sets the Content-Type header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
None
Returns the header value.
SetIfMatch
public "CCS DIS Web Service Adapter" SetIfMatch(Value: Text): Text
Sets the If-Match header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
Text
Returns the header value.
SetOcpApimSubscriptionKey
public "CCS DIS Web Service Adapter" SetOcpApimSubscriptionKey(Value: Text): Text
Sets the Ocp-Apim-Subscription-Key header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
Text
Returns the header value.
SetRequestContent
public "CCS DIS Web Service Adapter" SetRequestContent(Value: JsonToken): None
Sets the request body content.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | JsonToken |
The request body content. |
Return Value
None
SetRequestContent
public "CCS DIS Web Service Adapter" SetRequestContent(Value: HttpContent): None
Sets the request body content.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | HttpContent |
The request body content. |
Return Value
None
SetRequestContent
public "CCS DIS Web Service Adapter" SetRequestContent(Value: Text): None
Sets the request body content.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The request body content. |
Return Value
None
SetRequestContent
public "CCS DIS Web Service Adapter" SetRequestContent(TempBlob: Codeunit "Temp Blob"): None
Sets the request body content.
Parameters
| Name | Type | Description |
|---|---|---|
| TempBlob | Codeunit "Temp Blob" |
Return Value
None
SetTimeout
public "CCS DIS Web Service Adapter" SetTimeout(Value: Integer): Integer
Sets the request timeout.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Integer |
The request timeout in milliseconds. |
Return Value
Integer
The timeout value.
SetUrl
public "CCS DIS Web Service Adapter" SetUrl(Value: Text): Text
Sets the request url.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The request url. |
Return Value
Text
The URL value.
SetXFunctionsKey
[NonDebuggable]
public "CCS DIS Web Service Adapter" SetXFunctionsKey(Value: Text): Text
Sets the X-Functions-Key header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
Text
Returns the header value.
SetXHttpMethod
public "CCS DIS Web Service Adapter" SetXHttpMethod(Value: Text): Text
Sets the X-Http-Method header.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The header value. |
Return Value
Text
Returns the header value.
ShowError
public "CCS DIS Web Service Adapter" ShowError(): None
Shows the response error. Runs an UI notification if the response message can be evaluated into a JSON token.
Runs an UI error otherwise.
Return Value
None
UrlDecode
public "CCS DIS Web Service Adapter" UrlDecode(Value: Text): Text
Decodes an (encoded/escaped) value.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The value to be decoded. |
Return Value
Text
The decoded value.
UrlEncode
public "CCS DIS Web Service Adapter" UrlEncode(Value: Text): Text
Escapes a value for URI.
Runs UriEscapeDataString.
Parameters
| Name | Type | Description |
|---|---|---|
| Value | Text |
The value to be escaped. |
Return Value
Text
The escaped value.
Events
OnBeforeClientSend
event "CCS DIS Web Service Adapter" OnBeforeClientSend(var Client: HttpClient; var RequestMessage: HttpRequestMessage; var IsHandled: Boolean; var MockupIsSuccessStatusCode: Boolean)
The event is fired before the http request (client) is send.
Subscribe this event for IsHandled pattern.
Parameters
| Name | Type | Description |
|---|---|---|
| Client | HttpClient |
The client request to be send. |
| RequestMessage | HttpRequestMessage |
The request message for the client. |
| IsHandled | Boolean |
Set to true, if the default logic should be skipped. |
| MockupIsSuccessStatusCode | Boolean |
Defines the IsSuccessStatusCode (return value) if the IsHandled pattern is used. |
Attributes
| Name | Arguments |
|---|---|
| IntegrationEvent | False, False |
OnBeforeGetResponseContent
event "CCS DIS Web Service Adapter" OnBeforeGetResponseContent(var MockupContentAsText: Text; var IsHandled: Boolean)
The event is fired before the response content is retrieved from the response message.
Subscribe this event for IsHandled pattern with custom content.
Parameters
| Name | Type | Description |
|---|---|---|
| MockupContentAsText | Text |
Defines the custom content if the IsHandled pattern is used. |
| IsHandled | Boolean |
Set to true, if the default logic should be skipped. |
Attributes
| Name | Arguments |
|---|---|
| IntegrationEvent | False, False |
OnBeforeGetResponseError
event "CCS DIS Web Service Adapter" OnBeforeGetResponseError(var IsHandled: Boolean; var MockupReasonPhrase: Text)
The event is fired before the response error is retrieved from the response message.
Parameters
| Name | Type | Description |
|---|---|---|
| IsHandled | Boolean |
Set to true, if the default logic should be skipped. |
| MockupReasonPhrase | Text |
The error phrase to be return if the IsHandled pattern is used. |
Attributes
| Name | Arguments |
|---|---|
| IntegrationEvent | False, False |