Quality attribute characteristics
The is a SOAP web service interface named OpcPurchaseOrderService. The main purpose of this web service is to allow clients to place a purchase order.
String submitPurchaseOrder(PurchaseOrder poObject)
Submit a complete purchase order for an adventure package. This operation returns the order ID as a String. The operation simply checks if the PurchaseOrder argument is valid. If it is valid, the order is created in the database and this operation returns to the caller. The actual processing of the purchase order is carried on in background. If there is some unforeseen error during the processing of the purchase order after this operation has returned to the caller, the error is handled elsewhere and is not the responsibility of this interface.
boolean cancelPurchaseOrder(String orderId)
Cancel the given purchase order. The operation returns true if the order was canceled successfully; it returns false when the purchase order processing is in a state where some bookings are already confirmed and cannot be canceled.
String poId
String userId
String emailId
DateTime orderDate
DateTime startDate
Activity[] activities
ContactInfo billingInfo
ContactInfo shippingInfo
CreditCard creditCard
String departureCity
Transportation departureFlightInfo
Transportation returnFlightInfo
Lodging lodging
DateTime endDate
int headCount
String locale
float totalPrice
String activityId
DateTime endDate
int headCount
String location
String name
float price
DateTime startDate
Address address
String email
String familyName
String givenName
String phone
String city
String country
String postalCode
String state
String streetName1
String streetName2
String cardExpiryDate
String cardNumber
String cardType
String carrier
DateTime departureDate
String departureTime
String destination
int headCount
String origin
float price
String transportationId
String travelClass
DateTime endDate
String location
String lodgingId
String name
int noNights
int noRooms
float pricePerNight
DateTime startDate
All operations in this interface can raise the following exception, in addition to operation specific exceptions:
N/A
Currently we only expose placing a purchase order as a single web service that includes placing orders for activities, transportation and lodging. We don't provide separate operations to place an order only for flights, lodging or activities. Therefore, this interface is less flexible in terms of composing different kinds of orders. On the other hand, submitting a complete purchase order involves a single call.
Since the consumer website and the order processing center reside in the same enterprise, we avoid using complex XML processing and pass parameters as Java objects. It makes the interface slightly less interoperable but simplifies implementation.
This web service is published as a WSDL in a well known location (static web service instead of using a registry) since it is not available for general public use. It is only used by the consumer website. The option to use SOAP instead of Java RMI or direct EJB calls is motivated by the possibility of replacing the Consumer website implementation with a different technology (e.g., .NET); SOAP can provide the required interoperability in that case.
We chose the EJB endpoint type because the order processing center is implemented using a set of session beans.
Context ic = new InitialContext();
Service opcPurchaseOrderSvc = (Service) ic.lookup("java:comp/env/service/OpcPurchaseOrderService");
PurchaseOrderIntf port = (PurchaseOrderIntf) opcPurchaseOrderSvc.getPort(PurchaseOrderIntf.class);
String orderId = port.submitPurchaseOrder(myPurchaseOrder);