Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The UDRs were generated from the API specification provided by SAP for both the Charging and Loading services, and the released API version. The REST API version configured on the SAP CC REST agent must be aligned with the REST API version used by the SAP CC server for Charging and Loading services to be sent and received.

Prerequisites

The reader of this information should be familiar with:

Overview

There are two primary request UDRs, the usage being dependent on which REST API service is configured on the agent:

  • SAPCCChargingRequest UDR. The main UDR expected by the SAP CC REST agent when the Charging Service REST API is selected and can be returned to the agent with a response attached.

  • SAPCCLoadingRequest UDR. The main UDR expected by the SAP CC REST agent when the Loading Service REST API is selected and can be returned to the agent with a response attached.

Supported Services

Within each services provided by SAP Convergent Charging, there are a number of possible APIs to be called. The following table details the currently supported services and APIs, along with the expected UDR to be passed into the primary request UDRs for each.

...

Code Block
SAPCCChargingRequest requestUdr = udrCreate(SAPCCChargingRequest);
ChargingRequest udr = udrCreate(ChargingRequest);
......
requestUdr.request = udr;

Response Handling

Responses from SAP Convergent Charging are returned under the original request UDR, in the request.response.body parameter. The output will first have to be casted to the correct UDR, then cast the body into the respective UDRs described above, for further processing. An example using the above Event Based Rating API as below.

Code Block
if(instanceOf(input, SAPCCChargingRequest)){
    SAPCCChargingRequest resp = (SAPCCChargingRequest) input;
    if(instanceOf(resp.response.body, ChargingResponse)){
		// Logic if response body is ChargingResponse
    }
    else{
		// Logic if response body is not ChargingResponse
    }
}
else if(instanceOf(input, erroUDR)){
    // Logic if there are errors when sending request
}

Error Handling

The response HTTP status code can be accessed using input.response.statusCode.

...

The list of available SAP CC REST UDRs can be viewed in the UDR Internal Format Browser in the sapcc_rest folder. To open the browser, open an APL Editor, and, in the editing area, right-click and select UDR Assistance.

SAPCCChargingRequest

The following fields are included in the SAPCCChargingRequest UDR:

Field

Description

request (DRUDR)

The following UDRs can be included in this field:

  • ChargingRequest

  • ChargingSessionCreateRequest

  • ChargingSessionStopRequest

  • ChargingSessionUpdateRequest

requestUri (string)

The request URI included in the response from SAP Convergent Charging.

response (Response (http))

This field is populated by the contents of https://infozone.atlassian.net/wiki/spaces/MD93UEPE4D/pages/edit-v2/319717377#Response342392923#Response.

sessionId (string)

The sessionId identifier when sending a request to Session Based Rating (Update or Stop session).

SAPCCLoadingRequest

Field

Description

request (list<DRUDR>)

The following Loading request item can be included in this field:

  • List of ChargeableItem

requestUri (string)

Set the URI path to be used for the request.

response (Response (http))

This field is populated by the contents of https://infozone.atlassian.net/wiki/spaces/MD93UEPE4D/pages/edit-v2/319717377#Response342392923#Response.

errorUDR

Field

Description

errorMessage

Description of the error.

originalUDR

The input UDR received by the agent.

The Cookie UDR is used for including cookie information in https://infozone.atlassian.net/wiki/spaces/MD93UEPE4D/pages/edit-v2/319717377#Response342392923#Response.
 The following fields are included in the Cookie UDR:

Field

Description

domain (string)

The domain to which the cookie belongs.

expires (string)

The date and time when the cookie expires.

httponly (boolean)

If set to true, cookies will not be exposed through channels other than HTTP and HTTPS requests.

name (string)

The name of the cookie.

path (string)

The path to the page the cookie belongs to, for example "http://mydomain.com/mypage.html ".

secure (boolean)

Indicates whether the data is sent in secure mode or not.

value (string)

The value of the cookie.

Response

The Response  UDR contains the response to the request and is incorporated in the https://infozone.atlassian.net/wiki/spaces/MD93UEPE4D/pages/edit-v2/319717377#SAPCCChargingRequest342392923#SAPCCChargingRequest and https://infozone.atlassian.net/wiki/spaces/MD93UEPE4D/pages/edit-v2/319717377#SAPCCLoadingRequest342392923#SAPCCLoadingRequest.

The following fields are included in the Response UDR:

Field

Description

body (any)

This field contains the message body, that is, the payload, of the response. Responses are present as follows:

For Charging Service Requests:

  • ChargingResponse

  • ChargingSessionCreateResponse

  • ChargingSessionUpdateResponse

  • OnErrorResponse

For Loading Service Requests:

  • LoadingResponse

  • OnErrorResponse

cookies (list<CookieUDR>)

This field contains any https://infozone.atlassian.net/wiki/spaces/MD93UEPE4D/pages/edit-v2/319717377#Cookie342392923#Cookie UDRs included.

headers (map<string,list<string>>)

This field is populated by all the headers present in the response. The map keys contain header field names and the content is stored in the corresponding map values.

httpVersion (string)

This field contains the HTTP version; HTTP/1 or HTTP/2.

mimetype (string)

The type of the content, for example "text/html", "image/gif", etc.

openAPIUDR (DRUDR)

Used for custom OpenAPI specification validation, which is currently unavailable.

statusCode (int)

The HTTP status code, for example: 200 - OK, 404 - Not Found, etc.

validationErrors (string)

Used for custom OpenAPI specification validation, which is currently unavailable.

...