> Would something like:
> 
> @WSDLDocumentation {
>     String text
>     Format format = Format.TEXT
>     Placement placement
>     Class<?> faultClass
> 
>     enum Format {
>        TEXT, XML
>     };
>  }
> 
> be easier to write?    If it's Format.XML, we parse the string as XML.

It certainly would be easier to write. And to code.

My suggestion was based on the idea that CXF should model the
documentation in accordance to javax.wsdl.Definition, which uses a DOM
Element for that. And provide backwards-compatibility by making the
existing String getDocumentation() a shortcut returning the text
content of the Element.

Should the need ever arise to model the WSDL more closely, the
modification you describe above would have to be undone, hence leading
to backwards-compatibility problems and general messiness.

And using that way, you wouldn't be able to handle the WSDL -> Java
conversion. How would you decide whether it's XML or TEXT? And even if
you managed to decide that, you couldn't provide programmatic access to
the documentation structure (via an annotation handler) either.

Olivier.


On Thu, 2011-10-13 at 12:49 -0700, Daniel Kulp wrote:
> 
> On Thursday, October 13, 2011 10:44:52 AM Olivier Costet wrote:
> > Hi everyone,
> > 
> > First, one word to say I quite appreciate the CXF framework. Powerful,
> > rather sleek and nice code. Like it.
> > 
> > Secondly, I have a request. For the purposes of a tool I'm building, I
> > need to be able to put child elements inside a wsdl:documentation
> > element. These children will be parsed and exploited on the other end.
> > 
> > I would like to be able to specify these programmatically. Unless I'm
> > mistaken, this currently isn't possible. @WSDLDocumentation only allows
> > specifying strings, just as
> > org.apache.cxf.service.model.AbstractPropertiesHolder holds
> > documentation only as a string, as opposed to an org.w3c.dom.Element
> > (note that javax.wsdl.WSDLElement uses an Element for that purpose).
> > 
> > What I would like would be something like this:
> > 
> > @WSDLDocumentation {
> >    String text
> >    Placement placement
> >    Class<?> faultClass
> >    WSDLDocumentationChild[] children
> > }
> > 
> > @WSDLDocumentationChild {
> >    String text
> >    String namespace
> >    String elementName
> >    WSDLDocumentationChildAttribute[] attributes
> >    WSDLDocumentationChild[] children
> > }
> >    
> > @WSDLDocumentationChildAttribute {
> >    String name
> >    String value
> > }
> > 
> > Any chance ? :o)
> 
> That looks like it wouldn't be  very fun to actually write in the code.   
> Would something like:
> 
> @WSDLDocumentation {
>     String text
>     Format format = Format.TEXT
>     Placement placement
>     Class<?> faultClass
> 
>     enum Format {
>        TEXT, XML
>     };
>  }
> 
> be easier to write?    If it's Format.XML, we parse the string as XML.
> 
> Dan
> 
> 
> 
> > 
> > 
> >  Olivier.
> > 

-- 
Sanity and insanity overlap a fine grey line.

Reply via email to