Hi

On 28/11/11 11:00, Björn Stenersen wrote:
Hi Sergey,
it looks much better now:

<representation mediaType="application/xml" element="prefix1:Rating"/>

But why is the namespace called "prefix1", although i declared it as "hn":

@XmlRootElement(name = "Rating", namespace = "hn")
public class Rating {
...
}
"hn" is a namespace name, and "prefix1" is a prefix binding Rating to that namespace; at the moment you can customize the prefix names using a namespacePrefix property:

http://cxf.apache.org/docs/jaxrs-services-description.html#JAXRSServicesDescription-CustomizingWADLGeneration

HTH, Sergey



Am 28.11.2011 11:45, schrieb Sergey Beryozkin:
Hi

On 28/11/11 09:32, Björn Stenersen wrote:
Hi,
i have got a service that looks like this:

@GET
@Path("/rating/{id}")
@Produces("application/xml")
@ElementClass(response=Rating.class)
public Rating getRating(@PathParam("id")String id);

This is the Rating-Class:

@XmlRootElement(name = "Rating")
public class HotelRating {
...
}

In the resulting WADL the Grammar-Section describes the Rating-Object as
it should do.
The Resources-Section describes the service like this:

<resource path="rating/{id}">
<param name="id" style="template" type="xs:string"/>
<method name="GET">
<request/>
<response>
<representation mediaType="application/xml"/>
</response>
</method>
</resource>

Why is the representation-element missing the Attribute "element"? I
expected something like this:
<representation mediaType="application/xml" element="rating"/>

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;

Cheers, Sergey


What am i doing wrong?
Thanks Björn






--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to