SLIDE 1
Technical University of Denmark Fall 2016 DTU Compute Homework week 1
- H. Baumeister
November 12, 2018 Associate Professor
02267: Software Development of Web Services
1.1 Software installation
- Install the OpenESB v3 software (includes the Netbeans IDE) and the Glassfish v4
application server on your computer. Instructions for installing the software can be found at http://www.imm.dtu.dk/courses/02267. 1.2 Web Service Implementation
- Implement a simple Order Web service. The service has operations orderProduct,
payOrder, getOrderInfo”, i.e, – orderProduct takes an order number (string), customer name (string), an amount (integer), and a product (string) and returns the order number as a string – getOrderInfo takes as argument an order number and returns a string with the information of the order, e.g., ”Order number 2: Customer Peter has ordered 10 pencil. Payment is okay” for an order made by customer Peter who has
- rdered 10 amount of product ”pencil” and where payment was okay. If the
payment is not okay, then ”Payment is not okay” should be returned instead
- f ”Payment is okay”
– payOrder is a service that initiates payment by taking as argument a credit card number (string), e.g. ”12345”, and an order number (string). The result is true if the payment succeeds and false if not. ∗ Note that you don’t have to implement the business logic for payment (this will come later). Instead, for some fixed customer names, the payment always succeeds and for other customer names, the payment always fails – These functions are best implemented using a HashMap<String, Order>, where Order is class with attributes orderNumber (string), customer (string), product (string), amount (int), and isPaid (boolean) ∗ Note that the business logic should be very simple, e.g., the business logic does not need to check if there already exists an order with the same
- rder number in the map (this will come later). The existing entry is just
- verritten.
- Implement a JUnit test class that is using the order Web service.