This step demonstrates the JAXB functionality in OEPE by creating JAXB classes from an XML Schema (XSD) file and using them in the
Trouble Ticket System projects.
Review the XML Schema(XSD) structure
Create a new folder
xsd under the
ticketSystem.xsd file from the lab resources to the
ticketSystem.xsd file to open with the WTP
XML Schema Editor .
ProductType is a complex type representing the product details like ID, product code, name, and description.
ProductResultType is a complex type that has list of products.
TechnicianType is a complex type for technician details like ID, password, name and email.
TicketType is a complex type that represents a ticket being submitted with details like ID, the product for which it has been submitted, customer details, ticket title, description, date of submission, and ticket state. It also describes the technician details, if its assigned. It holds information about every event being performed on the ticket using
TicketHistoryType is a complex type describing an event being performed on a ticket, for example, a ticket being assigned or closed.
TicketStateType is a simple type with a restriction that only accepts string of value either NEW or OPEN or ASSIGNED or FIXED or CAN_NOT_FIXED.
TicketResultType is a complex type for showing a list of tickets.
faultInfo is an element for submitting error detail messages.
Generate JAXB classes based on the XSD
ticketSystem.xsd file and choose
WebLogic Web Services > Generate JAXB Types...
If you want to keep the generated ANT script then choose the option
Keep generated Ant script. Click
Choose the option
Include source code in JAR and click
The JAR file
ticketSystem.xsd.jar is created in the
If you like, you can double click on the
ticketSystem.xsd.jar to view the contents in WinZip in a file explorer window. The Java classes, which are annotated with JAXB annotations, are generated for each type defined in the XML schema.
Click the arrow below to navigate through the tutorial: