You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by James Strachan <ja...@gmail.com> on 2007/05/02 12:33:34 UTC

contract first using either XSD or XML plus Trang

Writing WSDL by hand is a bit sucky. I enjoyed Craig's recent post...

http://jroller.com/page/habuma?entry=contract_first_i_do_not

I wondered if anyone had ever looked at creating some contract-first
tooling which was like this...

a)  example XML documents -> XSD
b) XSD with naming conventions/annotations -> WSDL
c) WSDL to Java (as we currently have)

i.e. so folks could start at a, b or c rather than just forcing folks
to write WSDL.

e.g. it'd be cool to extend the maven tooling so you could just list
the example XML documents to use to create the XSD to create the WSDL
to create the Java contracts :)

On the home page it seems to kinda say there's code generation for XSD
to WSDL, but I've not spotted any examples yet. Is this true? I've
seen the XSD to Java (which seems to be like the JAXB2 XSD to Java
stuff). I was wondering if folks had looked at doing XSD to WSDL and
using trang to add example-XML to XSD etc?

-- 
James
-------
http://macstrac.blogspot.com/

Re: contract first using either XSD or XML plus Trang

Posted by Dan Diephouse <da...@envoisolutions.com>.
I think (b) is really important. It allows you to do schema first
development without the bulls*t of the WSDL. Once you get that working, its
real easy to support (a).

FWIW, (b) is already somewhat possible. XSD->JAXB. Then you can write your
service interface using JAXB beans. CXF should then generate the WSDL for
you. (Although this will probably lose the original schema documentation,
since JAXB will regenerate the schema. We need a way to supply just
schemas).

Cheers,
- Dan


On 5/2/07, James Strachan <ja...@gmail.com> wrote:
>
> Writing WSDL by hand is a bit sucky. I enjoyed Craig's recent post...
>
> http://jroller.com/page/habuma?entry=contract_first_i_do_not
>
> I wondered if anyone had ever looked at creating some contract-first
> tooling which was like this...
>
> a)  example XML documents -> XSD
> b) XSD with naming conventions/annotations -> WSDL
> c) WSDL to Java (as we currently have)
>
> i.e. so folks could start at a, b or c rather than just forcing folks
> to write WSDL.
>
> e.g. it'd be cool to extend the maven tooling so you could just list
> the example XML documents to use to create the XSD to create the WSDL
> to create the Java contracts :)
>
> On the home page it seems to kinda say there's code generation for XSD
> to WSDL, but I've not spotted any examples yet. Is this true? I've
> seen the XSD to Java (which seems to be like the JAXB2 XSD to Java
> stuff). I was wondering if folks had looked at doing XSD to WSDL and
> using trang to add example-XML to XSD etc?
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>



-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Re: contract first using either XSD or XML plus Trang

Posted by James Strachan <ja...@gmail.com>.
On 5/2/07, Polar Humenn <ph...@iona.com> wrote:
> I don't see why we need yet another way to write things in CXF.

Did you read Craig's post I was referring to?
http://jroller.com/page/habuma?entry=contract_first_i_do_not

the idea was to avoid working directly with WSDL and using either XSD
or something that makes XSD (RelaxNG or example XML documents) as the
source to generate the WSDL for CXF to work from.


> The XML schemas serve as the single definitive executable
> 'specification' language for
> the various bits of XML needed to configure and use CXF.

I wasn't talking about configuration of CXF, purely of creating SOA
contracts (of which a WSDL is often an end product).


> It's bad enough that there is some disconnect between XML schemas and
> the java code and keeping those consistent can be a nightmare, then to
> add another level of indirection?
>
> I'm no fan of XML, or programming in XML, but it's already hard enough
> to try and figure this stuff out and what's going on.

i wasn't gonna force any of this on you - stick to XSDs if you prefer
:). I know given the choice I'd always use RelaxNG Compact Syntax if I
was writing a schema by hand; but in now way would I want to force the
whole world to ditch XSDs


> If you were going to use this RelaxNG stuff, then there should be a push
> to *completely* eliminate XML schema from the entire project and just
> use RelaxNG (or something of the sort) as the single definitive
> executable specification language.

Why?
-- 
James
-------
http://macstrac.blogspot.com/

Re: contract first using either XSD or XML plus Trang

Posted by Polar Humenn <ph...@iona.com>.
Sergey,

I have no problem with more readable languages. I think of XML as a 
ascii based "interchange" language, and not something to be read by 
human being, but it would seem a lot of others disagree.

I'm just saying that we shouldn't have both, because there will always 
be some incompatibility between the two and that will cause headaches, 
especially when people need to "translate" from one to the other *and* 
visa versa.

Cheers,
-Polar

Sergey Beryozkin wrote:
> Hi Polar
>
> The reason I like the idea is that it wil make CXF more appealing to a wider audience.
> This is one of those areas where the religious debetae does not really help. Yes, most people are using
> XMLSchema, but there's a fairly large group of developers believing RelaxNG has the edge in terms of simplicity, in terms of making it easy to support the compatible evolution of XML (Web) services, etc...
> Java JBI spec uses RelaxNG schema...
> Making it possible for people to choose between RelaxNG and XMLSchema will just make CXF more popular and bring more developers under its tent, as simple as that.
>
> Cheers, Sergey
>
>
>   
>> I don't see why we need yet another way to write things in CXF.
>>
>> The XML schemas serve as the single definitive executable 
>> 'specification' language for
>> the various bits of XML needed to configure and use CXF.
>>
>> It's bad enough that there is some disconnect between XML schemas and 
>> the java code and keeping those consistent can be a nightmare, then to 
>> add another level of indirection?
>>
>> I'm no fan of XML, or programming in XML, but it's already hard enough 
>> to try and figure this stuff out and what's going on.
>>
>> If you were going to use this RelaxNG stuff, then there should be a push 
>> to *completely* eliminate XML schema from the entire project and just 
>> use RelaxNG (or something of the sort) as the single definitive 
>> executable specification language.
>>
>> Just my 27,255.55 Turkish Lira, :-)
>> -Polar
>>
>>
>>
>> James Strachan wrote:
>>     
>>> Incidentally there's an Ant task for working with Trang which could be
>>> easily used in a maven plugin to turn relax or example XML documents
>>> into XSDs...
>>>
>>> http://www.dehora.net/code/trang/trangtask.html
>>>
>>>       


Re: contract first using either XSD or XML plus Trang

Posted by Sergey Beryozkin <se...@iona.com>.
Hi Polar

The reason I like the idea is that it wil make CXF more appealing to a wider audience.
This is one of those areas where the religious debetae does not really help. Yes, most people are using
XMLSchema, but there's a fairly large group of developers believing RelaxNG has the edge in terms of simplicity, in terms of making it easy to support the compatible evolution of XML (Web) services, etc...
Java JBI spec uses RelaxNG schema...
Making it possible for people to choose between RelaxNG and XMLSchema will just make CXF more popular and bring more developers under its tent, as simple as that.

Cheers, Sergey


>I don't see why we need yet another way to write things in CXF.
> 
> The XML schemas serve as the single definitive executable 
> 'specification' language for
> the various bits of XML needed to configure and use CXF.
> 
> It's bad enough that there is some disconnect between XML schemas and 
> the java code and keeping those consistent can be a nightmare, then to 
> add another level of indirection?
> 
> I'm no fan of XML, or programming in XML, but it's already hard enough 
> to try and figure this stuff out and what's going on.
> 
> If you were going to use this RelaxNG stuff, then there should be a push 
> to *completely* eliminate XML schema from the entire project and just 
> use RelaxNG (or something of the sort) as the single definitive 
> executable specification language.
> 
> Just my 27,255.55 Turkish Lira, :-)
> -Polar
> 
> 
> 
> James Strachan wrote:
>> Incidentally there's an Ant task for working with Trang which could be
>> easily used in a maven plugin to turn relax or example XML documents
>> into XSDs...
>>
>> http://www.dehora.net/code/trang/trangtask.html
>>
>

Re: contract first using either XSD or XML plus Trang

Posted by Polar Humenn <ph...@iona.com>.
I don't see why we need yet another way to write things in CXF.

The XML schemas serve as the single definitive executable 
'specification' language for
the various bits of XML needed to configure and use CXF.

It's bad enough that there is some disconnect between XML schemas and 
the java code and keeping those consistent can be a nightmare, then to 
add another level of indirection?

I'm no fan of XML, or programming in XML, but it's already hard enough 
to try and figure this stuff out and what's going on.

If you were going to use this RelaxNG stuff, then there should be a push 
to *completely* eliminate XML schema from the entire project and just 
use RelaxNG (or something of the sort) as the single definitive 
executable specification language.

Just my 27,255.55 Turkish Lira, :-)
-Polar



James Strachan wrote:
> Incidentally there's an Ant task for working with Trang which could be
> easily used in a maven plugin to turn relax or example XML documents
> into XSDs...
>
> http://www.dehora.net/code/trang/trangtask.html
>


Re: contract first using either XSD or XML plus Trang

Posted by James Strachan <ja...@gmail.com>.
Incidentally there's an Ant task for working with Trang which could be
easily used in a maven plugin to turn relax or example XML documents
into XSDs...

http://www.dehora.net/code/trang/trangtask.html

-- 
James
-------
http://macstrac.blogspot.com/

Re: contract first using either XSD or XML plus Trang

Posted by Sergey Beryozkin <se...@iona.com>.
+1, it would be nice if CXF supported it as the alternative schema language...

Cheers, Sergey


----- Original Message ----- 
From: "James Strachan" <ja...@gmail.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, May 02, 2007 1:44 PM
Subject: Re: contract first using either XSD or XML plus Trang


> On a related note - I love the RelaxNG compact syntax...
> 
> http://relaxng.org/compact-tutorial-20030326.html
> 
> it makes XSD look so, well, XML :)
> 
> it'd be great if folks could write schemas easily in Relax NG then use
> that to feed the XSD generation & WSDL generation. Trang can handle
> the conversion nicely.
> 
> 
> On 5/2/07, James Strachan <ja...@gmail.com> wrote:
>> Writing WSDL by hand is a bit sucky. I enjoyed Craig's recent post...
>>
>> http://jroller.com/page/habuma?entry=contract_first_i_do_not
>>
>> I wondered if anyone had ever looked at creating some contract-first
>> tooling which was like this...
>>
>> a)  example XML documents -> XSD
>> b) XSD with naming conventions/annotations -> WSDL
>> c) WSDL to Java (as we currently have)
>>
>> i.e. so folks could start at a, b or c rather than just forcing folks
>> to write WSDL.
>>
>> e.g. it'd be cool to extend the maven tooling so you could just list
>> the example XML documents to use to create the XSD to create the WSDL
>> to create the Java contracts :)
>>
>> On the home page it seems to kinda say there's code generation for XSD
>> to WSDL, but I've not spotted any examples yet. Is this true? I've
>> seen the XSD to Java (which seems to be like the JAXB2 XSD to Java
>> stuff). I was wondering if folks had looked at doing XSD to WSDL and
>> using trang to add example-XML to XSD etc?
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/

Re: contract first using either XSD or XML plus Trang

Posted by James Strachan <ja...@gmail.com>.
On a related note - I love the RelaxNG compact syntax...

http://relaxng.org/compact-tutorial-20030326.html

it makes XSD look so, well, XML :)

it'd be great if folks could write schemas easily in Relax NG then use
that to feed the XSD generation & WSDL generation. Trang can handle
the conversion nicely.


On 5/2/07, James Strachan <ja...@gmail.com> wrote:
> Writing WSDL by hand is a bit sucky. I enjoyed Craig's recent post...
>
> http://jroller.com/page/habuma?entry=contract_first_i_do_not
>
> I wondered if anyone had ever looked at creating some contract-first
> tooling which was like this...
>
> a)  example XML documents -> XSD
> b) XSD with naming conventions/annotations -> WSDL
> c) WSDL to Java (as we currently have)
>
> i.e. so folks could start at a, b or c rather than just forcing folks
> to write WSDL.
>
> e.g. it'd be cool to extend the maven tooling so you could just list
> the example XML documents to use to create the XSD to create the WSDL
> to create the Java contracts :)
>
> On the home page it seems to kinda say there's code generation for XSD
> to WSDL, but I've not spotted any examples yet. Is this true? I've
> seen the XSD to Java (which seems to be like the JAXB2 XSD to Java
> stuff). I was wondering if folks had looked at doing XSD to WSDL and
> using trang to add example-XML to XSD etc?
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>


-- 
James
-------
http://macstrac.blogspot.com/