SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Assignment 6: Webservices

Due at Thursday, December 10th, 11:00 am (before the lecture starts)
You find sample solutions in the SVN:

https://svn.iai.uni-bonn.de/repos/IAI_Software/se/atsc2009ws/samplesolutions/

Projects: A06T14_WSDL_Solution and A06T15_Payment_Paypal_Solution

A new (optional) task was added to this assignment after the initial publication!

Task 14: WSDL

3+2 points

a) Return messages

In the lecture, we gave an example for a WSDL description of a Webservice (Slide 42 of atsc-2009-06-SOA.pdf).

You can find this as A06T14_WSDL/myservice.wsdl.xml in your repository. In our example, the method myMethod did have an empty response. Now, we want to change it to return the two values and .

  1. First, extend the WSDL description in the file myservice.wsdl.xml accordingly.
  2. Then, write down the SOAP response we get for the call myMethod(5, 5.0) into the reponse.xml file.
If Eclipse only shows a hierarchical view when opening the XML files, click on the “Source” tab at the bottom to see the actual XML.1)

b) SOAP Encoding

Read the following article on the different WSDL styles: WSDL Style Overview. In the lecture and the examples we used the document/literal wrapped WSDL style. Why is this style commonly used and what are its limitations?

Task 15: Using a Web Service

4+1 points

a) Using the Paypal SOAP API

We would like to connect our Hotel to an external payment service. To have a realistic setting, we are using the real Paypal infrastructure!

Your task is completed when you payed 10 Euros to our Hotel's PayPal account. Of course no real money is transfered, we are using the testing (sandbox) environment. Check out the project A06T16_Payment_Paypal into your workspace an follow the instructions in org.iai.webservices.PaypalTest class.2)

The following resources are helpful for this task:

b) SOAP Headers

Look at the output of the test. What is the SOAP header used for? For what else could the header be used?

Task 16: Apply your EJB knowledge (Optional)

4 points

Session beans take the role of a controller in the EJB component model. Your task is to map a use case from task 7 to a session bean:

Use Case: Reserve

  • The customer selects to reserve a room.
    • The system displays the types of rooms the hotel has and their rates.
  • The customer selects the desired room type and indicates his period of stay.
    • The system computes the cost for the specified period and the reservation fee and displays this information.
  • The customer makes the reservation for the chosen room type.
    • The system creates an invoice containing the reservation fee.
    • The system deducts from the database the number of rooms of the specified type available for reservation.3)
    • The system creates a new reservation with the given details.
    • The system displays the reservation confirmation number and check-in instructions.
  1. Use the project A05T13-Hotel-EJB as a starting point.
  2. Add entity classes for all domain objects used in this use case. You may base this on your solution of Task 12: Invoice, Reservation,…
  3. Map all actions of the system to a session bean ReserveRooms. In a real implementation all display operation would be carried out on a (web) client, e.g. realized by the architectural pattern MVC. Here a unit test is sufficient which simulates the input and output of the session bean, e.g. calls a method to retrieve available rooms and checks the number of returned rooms.
  4. For such a mapping both session bean types are possible - stateless and stateful. In the first case the state of the reserve use case is held by the bean (e.g. selected room type) in the second case all state is kept by the client. Choose one type and explain your decision.
2)
Don't worry that the project shows errors after checkout. These come from the missing classes that you'll generate in the first step
3)
It is not necessary that you store the number of available rooms, if you demonstrate that you can retrieve this information based on the reservations in the database.
teaching/lectures/atsc/2009/assignment_6.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2025