- 18 Dec 2023
- 4 Minutes to read
- Print
Setting up a UDC test connection
- Updated on 18 Dec 2023
- 4 Minutes to read
- Print
In order to test the different web services (server and client) and to improve the stability of the spot via local data, it is possible to set up test connections. The corresponding parameters must be defined correctly and in part, have a limited validity.
Note
To secure a correct operation of the spot, the spot developer must ensure that the spot
is tested against all web services (server and client)
is transferred to all corresponding player types and the playback is tested (players have different web engines and therefore exhibit differing behavior).
The test connection is set up via the setLocalTestData function (see setLocalTestData). Below, the determination of the parameters as well as the creation of a local data file under the use of the browser developer tools is explained.
Using developer tools
The required values can be read out via the developer tools of the browser.
Note
We recommend Google Chrome. However, it's possible to use other browsers.
It is recommended, to permanently deactivate the browser cache and to filter the display of the requests as specified in the following image:
Testing of web services
Parameters for the server web service
Note
In order to allow for all required parameters to be read out, a corresponding spot with a UDC data source must be available in the IXM Platform.
IXM Platform: Log in and open the Edit spot properties window of the spot which should be tested under Content > Playlist> Selectable spots >
in the tile view of the spot.
Developer tools: Open the developer tools of the browser via the keyboard shortcut CTRL+SHIFT+I (for Windows operating systems only).
Developer tools: Switch to the Network tab.
Developer tools: Delete existing requests by clicking on the icon as illustrated in the image below.
IXM Platform: In the Edit spot properties window select the Data sources tab.
Developer tools: Click on the displayed number (Id), in order to display the corresponding details on the right.
Developer tools: In the pane Details switch to the Headers tab.
Developer tools: Select the request URL shown including „api/” and copy the highlighted value to the clipboard with CRTL+C.
Code: Replace the value of DebugServer.url with the value saved to the clipboard.
locationId
IXM Platform: Open the Edit player window of the player which should be tested under Channels > Location > [Name of the location] > Edit player.
Developer tools: Open the developer tools via the keyboard shortcut CRTL+SHIFT+I, switch to the Network tab and delete the existing requests.
IXM Platform: Click on the Data sources tab.
Developer tools: Identify the displayed value (Id).
Code: Use the value for DebugServer.locationId (see DebugServer).
spotId
IXM Platform: Open the spot properties.
Developer tools: Open the developer tools via the keyboard shortcut CRTL+SHIFT+I, switch to the Network tab and delete the existing requests.
IXM Platform: In the Edit spot properties window click on the Data sources tab.
Developer tools: Identify the displayed value (Id).
Code: Use the above value for DebugServer.spotId (see DebugServer).
sessionId
IXM Platform: Open the IXM Platform or if there is already one instance of the IXM Platform running, close the current session via the log out icon in the top right. The login window is shown.
Developer tools: Open the developer tools of the browser.
Developer tools: Switch to the Console.
Developer tools: Delete the existing values (see image):
IXM Platform: Log in to the IXM Platform.
Developer tools: Highlight the session key and copy it to the clipboard.
Code: Replace the value of DebugServer.sessionId with the value copied to the clipboard.
Note
The value for DebugServer.sessionId is only valid for the current session. For this reason, the window should be not closed during testing. The value must be renewed for every additional login as well as the above described process must be repeated.
Parameters for the client web service
Note
In order to allow for all required parameters to be read out, a corresponding spot with a UDC data source must be available in the IXM Platform. It must be also be available in a playlist which has been transferred to a player.
Ip
Player: Identify the IP address by pressing the F8 key.
Code: Use the displayed value for DebugClient.ip.
siid
IXM Platform: Log in and open the Edit display properties window of the spot instance which should be tested under Content > Playlist > General playlists > [Name of the playlist] Playlist content >
in the tile view of the spot.
Developer tools: Open the developer tools of the browser via the keyboard shortcut CRTL+SHIFT+I (for Windows operating systems only).
Developer tools: Switch to the Network tab.
Developer tools: Delete the existing request by clicking on the icon as shown in the image below.
IXM Platform: In the Edit display properties window click on the Data sources tab.
Developer tools: Identify the displayed value (Id).
Code: Use the above value for DebugClient.siid.
Creating local test data
In order to test the spot against local data, establish an initial test connection to the web services, optionally via server or client. For this, the corresponding data sources are accessed.
Following this, complete the steps below:
Browser: Open the spot in the browser via the ascInterface.
Developer tools: Open the developer tools via the keyboard shortcut CRTL+SHIFT+I.
Developer tools: Switch to the Network tab.
Developer tools: Identify the UDC request:
It starts with a distinct description (e.g. "News").
If there are two entries available, select the entry with the larger file size (it contains the data).
Developer tools: Click on the request in order to show the Details pane on the right.
Developer tools: Switch to the Response tab and copy its entire content to the clipboard.
Code: Create a new JSON file in the spot project (e.g. udc.json).
Code: Insert the content of the clipboard in the previously created file and save it.
Linking local test data
The JSON file created with local test data in the spot project can now be used as follows:
var udc = new GFUdcConnector();
var connection = {
url: "./udc.json"};
udc.setLocalTestData(connection);
// fetch some data...
Using local test data allows for a simple and convenient way to develop the spot against a static server and client solution. Further, it is possible to quickly modify the data and simulate various scenarios.