users@jersey.java.net

Re: [Jersey] FW: xml schema in request and response (wadl)

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 05 Nov 2009 09:55:13 +0100

On Nov 4, 2009, at 7:28 PM, Suchitha Koneru (sukoneru) wrote:

> Thanks Paul for the response.
> I haven't included javadoc tags as we do not have much java
> documentation added to the methods. Is java doc necessary for
> generating
> xsd references in the wadl's requests and responses ?

Yes. That is currently the only way to associate xsd references with
entities of resource methods.


> Is there any
> tutorial which gives instructions on adding jersey specific java doc ?

See the previous link i sent and also look at the JavaDoc of the
extended-wadl sample and the pom file.

Paul.

>
> -----Original Message-----
> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Sent: Wednesday, November 04, 2009 1:21 AM
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] FW: xml schema in request and response (wadl)
>
> Hi Suchitha,
>
> Did you include javadoc tags such as:
>
> * @response.representation.200.qname {http://www.example.com}item
>
> * @request.representation.qname {http://www.example.com}item
>
> on the resource methods?
>
> http://wikis.sun.com/display/Jersey/
> SupportedJavadocTagsForExtendedWADL
>
> Paul.
>
> On Nov 4, 2009, at 8:02 AM, Suchitha Koneru (sukoneru) wrote:
>
>>
>> Xml schemas are attached for reference.
>> From: Suchitha Koneru (sukoneru)
>> Sent: Tuesday, November 03, 2009 9:55 PM
>> To: users_at_jersey.dev.java.net
>> Subject: xml schema in request and response (wadl)
>>
>> Hello Jersey Users ,
>> I have looked into extended-wadl sample application. I
>> was able to generate the extended-wadl which has a href to the xml
>> schema. However, In the restful service methods , the xsd for the
>> request and response is not specified. It looks like specifying
>> mediaType alone will not suffice, we would also need the related xsd.
>>
>> For instance consider a snippet of the extended wadl
>> generated(also attached ). The consumer of the wadl will not be
>> aware of xml payload structure in requests/responses.
>>
>>
>> <resource path="Users">
>> <method name="GET" id="getAllUsers">
>> <response>
>> <representation mediaType="application/xml"/>
>> <representation mediaType="application/json"/>
>> </response>
>> </method>
>> <method name="PUT" id="updateUser">
>> <request>
>> <representation mediaType="application/xml"/>
>> </request>
>> <response>
>> <representation mediaType="*/*"/>
>> </response>
>> </method>
>> <method name="POST" id="createUser">
>> <request>
>> <representation mediaType="application/xml"/>
>> </request>
>> <response>
>> <representation mediaType="*/*"/>
>> </response>
>> </method>
>> <resource path="del/{userID}">
>> <param xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> type="xs:string" style="template" name="userID"/>
>> <method name="DELETE" id="deleteUser"/>
>> </resource>
>> <resource path="{userID}/">
>> <param xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> type="xs:string" style="template" name="userID"/>
>> <method name="GET" id="getUser">
>> <response>
>> <representation mediaType="application/xml"/>
>> </response>
>> </method>
>> </resource>
>>
>> The src code for customized wadl generator is
>>
>> public class SampleWadlConfigurator extends WadlGeneratorConfig {
>>
>> @Override
>> public List<WadlGeneratorDescription> configure() {
>> return generator( WadlGeneratorApplicationDoc.class )
>> .prop( "applicationDocsStream", "application-doc.xml" )
>> .generator( WadlGeneratorGrammarsSupport.class )
>> .prop( "grammarsStream", "application-grammars.xml" )
>> .descriptions();
>> }
>>
>>
>> Could you please let me know, if we can include xsd references in
>> request and response elements of the wadl(similar to a wsdl) .
>>
>> Thank you,
>> Suchitha.
>>
>> <application.wadl><schema1.xsd><schema2.xsd>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>