Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mrserverless committed Feb 12, 2014
1 parent 26c7f0b commit 0fe9964
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Uses:
* [Jackson XML Provider](https://github.com/FasterXML/jackson-jaxrs-xml-provider) for JAX-RS MessageBodyReader and MessageBodyWriter implementations
* [Jackson DataFormat XML](https://github.com/FasterXML/jackson-dataformat-xml) for XMLMapper, which inherits from the Jackson ObjectMapper
* [Woodstox](http://wiki.fasterxml.com/WoodstoxHome) for high performance XML processing under the hood
* [Gradle](http://www.gradle.org/) for the best of Ant plus Maven minus all the crap.
* [Gradle](http://www.gradle.org/) for the best of Ant plus Maven IMHO.

##Why
Dropwizard is fast, container-less and JSON is awesome. But understandably, XML files are deeply rooted into the IT ecosystem of many organisations. It would be great if the power and simplicity of Dropwizard to build XML RESTful web services, instead of relying on bloated frameworks and chunky application servers. That's what this project aims to do.
Expand All @@ -21,17 +21,35 @@ Certain configurations such as Indentation are switched on by default. Will atte
future.

##Usage
Unfortunately there is no maven repository yet. For now, simply download the project, run gradle or gradle wrapper to compile and install to your local maven repository:
Unfortunately there is no maven repository yet. For now, simply download the project, run gradlew or gradlew.bat to compile and install to your local maven repository:

gradlew install

To use the XML Provider, simply register it in your Application.Run() method:

env.jersey().register(new JacksonXMLMessageBodyProvider(JacksonXML.newXMLMapper(), env.getValidator()));

Don't forget to annotate your Resources accordingly with XML mediatype:
Annotate your Resources accordingly with XML mediatype:

@Produces(MediaType.APPLICATION_XML)
@Consumes(MediaType.APPLICATION_XML)

Annotate your model POJO with either Jackson bindings:

@JacksonXmlRootElement
@JacksonXmlProperty
@JacksonXmlElementWrapper

or JAXB:

@XmlType
@XmlAttribute
etc

And you can use the same validator annotations as you would with a JSON POJO when working with Dropwizard:

@NotNull
@Min
etc

Sample project coming soon.

0 comments on commit 0fe9964

Please sign in to comment.