I have an JAX-RS API and I'm generating wadl for it.
<application ....
..
<request>
<representation mediaType="application/xml"/>
</request>
..
</application>
But I want add element to representation to it.
<application ....
..
<request>
<representation mediaType="application/xml" element="prefix1:thebook"/>
</request>
..
</application>
thebook
should present in grammar.
My Service:
@Path("/update/book")
@POST
@Produces({MediaType.APPLICATION_JSON})
@ElementClass(request = Book.class)
@Consumes({MediaType.APPLICATION_XML})
String updateBook(Book book);
Book.java
@XmlRootElement(name = "inventoryBean")
public class Book {
private Long name;
private Long id;
// getters and setters
}
The Web Application Description Language (WADL) is a machine-readable XML description of HTTP-based web services. WADL models the resources provided by a service and the relationships between them. WADL is intended to simplify the reuse of web services that are based on the existing HTTP architecture of the Web.
WADL is the language instructed for explaining the traits or segments of HTTP web solutions/applications. Description of the app's all HTTP resources alongside their correlations and dependencies can be provided using it.
The Web Application Description Language (WADL) is an XML-based file format that describes your REST web services application. By default, a basic WADL is generated at runtime and can be accessed from your REST web service by adding a GET to the /application. wadl resource at the base URI of your REST application.
WSDL is an XML language for describing web services. Used to describe SOAP-based web services. WADL is an XML file-format . It is an XML vocabulary for expressing the behavior of HTTP resources.
There has to be a namespace declared somewhere, either in
@XmlRootElement
itself or in a package-level annotation, please add it
and you should see a proper link to a schema element;
In this case @XmlRootElement(name = "inventoryBean", namespace = "bean")
should do the job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With