- Start from the BookOrderWSService.wsdl in the lab directory
- OR (Alternative):
- start from the order.wsdl you created in module 3
- modify the order ComplexType to match the exercise instruction
- modify the orderId SimpleType to String
- Generate java classes from the WSDL
- Create a src and class directory
- run wsimport in the location where you have created these folders. wsimport should
- generate all classes in the service package
- put generated .class files in the class directory
- put generated .java files in the src directory
- Create a new Java Web Application project called bookOrder
- Copy the wsimport files to your project
- copy the src/service directory to the src directory of your project
- Move the bookOrder class to a newly created package domain
- Make a new directory wsdl in the WEB-INF directory (WEB-INF is under Web Pages) and copy the WSDL you obtained in step 1 here.
- Add constructors to domain.Orders
- add a constructor that takes all attributes as parameters
- add a constructor without parameters
- Implement the BookOrderService interface in a class BookOderWS
- Add these extra attributes
- endpointInterface
- wsdlLocation = "WEB-INF/wsdl/BookOrderWSService.wsdl"
- serviceName
- portName
- targetNamespace
- Add a static Map to BookOrderWS , which will act as a datastore:
-
private static Map<String,Order> orderDao = new HashMap<String,Order>();
- add a static block to the class in which you add some test data to orderDao. Use the orderID from the Order also as a key in the Map.
- Implement the orderBook method.
- Test and correct until everything works
7 September 2018
RD EE6 webservices module 10: lab cookbook
Labels:
DWS-4050-EE6
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment