Hi
This actually helps...Comments below
On 24/07/13 12:00, Julio Carlos Barrera Juez wrote:
Here, an example of XRD file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XRD>
<Subject>/path/to/service/A</Subject>
<Link rel="describedBy" type="contentType"
href="/info/about/the/contentType" />
<http-methods>
<http-method type="GET">
<primary-uri>/path/to/service/A</primary-uri>
<query-parameters />
<headers>
<header type="Accept">
<Link rel="describedBy" type="application/xrd+xml"
href="/info/about/the/contentType"
/>
<representations>
<representation>contentType</representation>
<representation>contentTypeB</representation>
</representations>
</header>
</headers>
</http-method>
<http-method type="DELETE" async="true">
<primary-uri>/path/to/service/A</primary-uri>
<query-parameters>
<query-parameter required="true">
<name>param!</name>
<type>string</type>
</query-parameter>
<query-parameter>
<name>paramB</name>
<type>string</type>
</query-parameter>
</query-parameters>
<headers>
<header type="Accept">
<Link rel="describedBy" type="contentType" href="/info/about/the/contentType"
/>
<representations>
<representation>contentType</representation>
<representation>contentTypeB</representation>
</representations>
</header>
</headers>
</http-method>
</http-methods>
</XRD>
It seems that it contains enough information describing the service. Anyway
I think I will need to write the interfaces manually.
I have an idea. I'm not sure we need an XRD-to-Java tool. But if the
above is rich enough for the purpose of the code-generation then what
about the following:
- enhance a wadl-to-java tool to accept an XSLT stylesheet (via
-stylesheet), if it is available then actual description document will
be run through this stylesheet first and then the actual code gen will
start.
The idea is that we can support this way XRD, WSDL2 or UML descriptions,
etc, we convert them to WADL first because I think WADL is very rich
specifically for the purpose of generating the typed code, it may lack
in some other areas like linking support, etc, but I think it 'accept'
via the transformation most of other descriptions.
Would you consider doing an XRD-to-WADL stylesheet, it does not have to
cover all the edge cases, something simple to start with to get your
example covered ?
I then can work on implementing a -stylesheet option support.
Cheers, Sergey
On 23 July 2013 13:16, Julio Carlos Barrera Juez <
[email protected]> wrote:
Well,
XRD and XRDS are used by OpenID and pretend to be WS definition standards
(more info here:
http://wiki.openid.net/w/page/12995256/XRD-based%20Service%20Discovery).
Anyway I'm having same problem, because I found XSD's defining WS model,
but not WADLs defining the service itself.
XRD's seems to define the service, but I don't want to create my client
manually, I'd prefer having a tool generating it from XRD.
On 23 July 2013 12:39, Sergey Beryozkin <[email protected]> wrote:
Hi
On 23/07/13 11:28, Julio Carlos Barrera Juez wrote:
Well, I have found that in the service I'm using, I have links to XSD
schemas inside the XRD files. It would help a lot ;-).
I'm not sure XRD is as 'capable' as WADL in providing enough metadata
to the client application or a generic one which can offer something on top
of WADL. May be I'm not yet appreciating what XRD is :-)
Cheers, Sergey
On 23 July 2013 12:17, Julio Carlos Barrera Juez <
[email protected]> wrote:
Hi all!
I want to generate a REST client of a REST service defined by XRD. Is it
possible to generate Java classes of the model and the service with an
XRD?
I know how to generate Java classes form WSDL and WADL files with
command
line tools or Maven plugins and goals, but not with XRD.
Thank you!