5.7. Add Server's Response

The sending of the request from the client to the server has been defined in the next step. The server sends back the course list, if it receives a valid getCourseList request. Therefore, a new event named handle response that receives the server's message with the course list has to be added at the client. In the server's event, an operation named send course list to client of type Response must be inserted. To send the course list, a new template is needed. Add this template, name it courseList, enter the following content and save it.

Example 5.2. Template 'courseList'

<courseList>
    <course>
        <name>Computer Engineering</name>
        <lecturer>Mustermann, Georg, Prof. Dr.</lecturer>
        <schedule>
            <time>Monday, 10:00-11:30</time>
            <room>42-110</room>
        </schedule>
        <schedule>
            <time>Friday, 8:00-10:00</time>
            <room>46-220</room>
        </schedule>
    </course>
    <course>
        <name>Software Engineering I</name>
        <lecturer>Prof. Dr. Georg Mustermann</lecturer>
        <schedule>
            <time>Tuesday, 15:30-17:00</time>
            <room>42-110</room>
        </schedule>
        <schedule>
            <time>Friday, 10:00-11:30</time>
            <room>46-220</room>
        </schedule>
    </course>
</courseList>


After the creation of the new template, it can be used in the server's operation. As all needed data is defined in the template, no manipulation of the template is needed. The test case should now look like shown in the following image:

Figure 5.12. Test case after adding third event

Test case after adding third event