Junos Space SDK > Developer Guides > Junos Space Application Developer Guide > Programming with the Junos Space SDK > Using the Junos Space SDK Plug-in > Using the EJB-REST Wizard

Creating Schema for Manually Written DTOs

This topic explains the procedure to generate DTO schema for your code. The Junos Space SDK provides an EJB-REST wizard for RESTifying code. As a result of using this wizard, the DTOs and schema for the code are generated automatically. However, the EJB-REST wizard does not create schema for any code other than the RESTified code.

Similarly, schemas for code that is manually written are not automatically generated by the build scripts, and the build scripts themselves for such code are not automatically generated by the Junos Space SDK plug-in's Generate Build Script option.

To create a schema for the DTO for manually written code (not produced by the EJB-REST wizard), follow these steps:

  1. In the Eclipse Project Explorer view, right-click the DTO.
  2. Select the Generate DTO Schema option. The Generate DTO Schema wizard is launched.

    1. The DTO schema is generated in the WebSvc project structure.

    1. You may need to change the name of the schema or the schema because the wizard does not always generate a correct schema for manually-written DTOs.
Note that the schema creation dialog will only generate a schema if it recognizes that your Java class is a valid DTO. For a class to be considered a valid DTO, it needs to have at least one field annotated with an @XmlAttribute. In other words, it must at least have a URI.

Also, note that you should really be using the EJB-REST Wizard, which generates all the schemas automatically. Using this manual procedure to generate schemas is not recommended.