Hi David - thanks for a quick confirmation;
A bit more work may still need to be done to do with minimizing the need
to use @XMlName when the default XmlType or explicit collection element
name calculation is not enough - because the customization info is
already available in a registered JAXB provider - we'll deal with it a
bit later on, @XMLName is there if needed for now
Cheers. Sergey
On 17/10/13 18:52, David Karlsen wrote:
OK - I did a build of 2.7.x-fixes myself.
It works! Excellent work!
2013/10/17 Sergey Beryozkin <[email protected]
<mailto:[email protected]>>
Not yet, I committed an hour ago
Cheers, Sergey
On 17/10/13 17:34, David Karlsen wrote:
That is great news. Is a snapshot version available?
17. okt. 2013 17:42 skrev "Sergey Beryozkin"
<[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>>
følgende:
I've committed some changes to 2.7.x:
- XmlType only annotated classes should now be processed as
expected,
the schema elements will be added in addition to what JAXB
compiler
generates, and the references from WADL reps to these elements
should be visible
- @XMLName is not needed unless default XmlType processing
needs to
be customized
- added a WadlGenerator constructor accepting a Bus - this
should
help with loading the external resources not visible to the
default
loader/resolver, in case you'd like to reuse the existing
schema
resources
Give it a try please when you get a chance,
Sergey
On 10/10/13 15:20, David Karlsen wrote:
No - I had it like this:
<bean
class="org.apache.cxf.jaxrs.____model.wadl.WadlGenerator">
<property
name="useJaxbContextForQnames" value="true" />
<property
name="addResourceAndMethodIds" value="true" />
</bean>
I've tried to:
<bean
class="org.apache.cxf.jaxrs.____model.wadl.WadlGenerator">
<property name="useJaxbContextForQnames" value="true" />
<property name="addResourceAndMethodIds" value="true" />
<property name="schemaLocations">
<list>
<value>/xsd/common-v1.xsd</____value>
........ additional schemas....
</list>
</property>
</bean>
also xsd/common-v1.xsd
or
classpath:xsd/common-v1.xsd
none of them are able to find the schema:
2013-10-10 16:00:26,113 [main][][][][][][][] WARN
org.apache.cxf.jaxrs.model.____wadl.WadlGenerator - No
schema resource
/xsd/common-v1.xsd can be loaded : null
the schemas are in another jarfile on the classpath -
so not in
the .war
which contains cxf-servlet.xml which contains the above
wadlgenerator config
2013/10/10 Sergey Beryozkin <[email protected]
<mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>
<mailto:[email protected]
<mailto:[email protected]> <mailto:[email protected]
<mailto:[email protected]>>>__>
Hi David
I'm doing some work on it, following our
conversation on IRC.
Let me double check one thing, do you configure
WADLGenerator with
the list of schemas to be included in the grammar
section ?
If not then WADLGenerator may have to create
xsd:elements
somehow
itself, similarly to the way it does it for explicit
collections
like List<Book>, because JAXB won't generate itself
xsd:element from
@XmlType only
Cheers. Sergey
On 08/10/13 09:34, David Karlsen wrote:
OK - been experimenting a little - it's due to
missing
XmlRootElement
annotations.
If I "inline" the type definition it will work.
This works:
<element name="customerCreateRequest">
<complexType>
<annotation>
<documentation>
Create a new distinct customer.
Customers have distinct customerIds within an
organization.
</documentation>
</annotation>
<sequence>
<element name="customer"
type="customer:customerType" />
</sequence>
</complexType>
</element>
instead of the more reusable (will not work):
<element name="customerCreateRequest"
type="tns:______customerCreateRequest">
<complexType name="customerCreateRequest">
<annotation>
<documentation>
Create a new distinct customer.
Customers have distinct customerIds within an
organization.
</documentation>
</annotation>
<sequence>
<element name="customer"
type="customer:customerType" />
</sequence>
</complexType>
Is there no way around this?
I thought that was what @XmlName was for.
2013/10/7 David Karlsen
<[email protected] <mailto:[email protected]>
<mailto:[email protected]
<mailto:[email protected]>__>
<mailto:[email protected]
<mailto:[email protected]>
<mailto:[email protected]
<mailto:[email protected]>__>__>>
Hi.
I did this:
@POST
@Consumes( {
MediaType.APPLICATION_XML} )
@Produces( {
MediaType.APPLICATION_XML } )
public void testCreate( @XMLName(
value =
"{urn:srv.jfr.tac.fs.edb.com:w______s:customer:v1}______customerCreateRequest"
) CustomerCreateRequest
customerCreateRequest ) {
And have also cleaned up the config.
2013/10/7 Sergey Beryozkin
<[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>
<mailto:[email protected]
<mailto:[email protected]>
<mailto:[email protected]
<mailto:[email protected]>>>__>
Hi David
On 07/10/13 10:54, David Karlsen wrote:
Hi.
I have an existing jax-ws service
that I now
additionally want to expose
as
a REST/jax-rs service.
I've configured it like this:
*http://pastebin.com/h7cy8ZYB *
The wadl generated looks like:
*http://pastebin.com/QQRbNb3n *
I would expect it to refer to the
request
/response
types not to look
like
<representation
mediaType="application/xml"/>
but rather something like:
<representation
mediaType="application/xml"
type="tns:**______customerCreateRequest" />
I've tried adding @XmlName etc but
nothing
changes.
I suspect the reason you don't have
the proper
mappings
generated is that
the JAX-WS generated code has the bean
parameters with
JAXB XMLType only
and the JAX-RS runtime does
wrap/unwrap the types.
How do you use XMLName ? It needs to
contain
extended
QNames, example "{
http://myns <http://myns/>}MyRootElement".
As a side note, the configuration can be
simplified:
- two conflicting JAXB providers, need
to drop
either
jaxrs:dataBinding
or JAXBProvider,
- two Jackson providers, I'm not sure
which one
will
work better in your
case, please try
- re the schema validation, you need
to get
that schema
list set up only
once, using SchemaHandler makes sense
only if
you reuse
it between CXF JAXB
and JSON providers, but you don't, so
drop it;
next , if
you decide to keep
JAXBProvider then drop
jaxrs:schemaLocations
Cheers, Sergey
Any hints?
--
David J. M. Karlsen -
http://www.linkedin.com/in/**______davidkarlsen
<http://www.linkedin.com/in/**____davidkarlsen>
<http://www.linkedin.com/in/**____davidkarlsen
<http://www.linkedin.com/in/**__davidkarlsen>>
<http://www.linkedin.com/in/**____davidkarlsen
<http://www.linkedin.com/in/**__davidkarlsen>
<http://www.linkedin.com/in/**__davidkarlsen
<http://www.linkedin.com/in/**davidkarlsen>>><http://www.
<http://www./>__li__n__kedin.com/in/davidkarlsen
<http://lin__kedin.com/in/davidkarlsen>
<http://linkedin.com/in/__davidkarlsen
<http://linkedin.com/in/davidkarlsen>>
<http://www.linkedin.com/in/____davidkarlsen
<http://www.linkedin.com/in/__davidkarlsen>
<http://www.linkedin.com/in/__davidkarlsen
<http://www.linkedin.com/in/davidkarlsen>>>>
--
--
David J. M. Karlsen -
http://www.linkedin.com/in/______davidkarlsen
<http://www.linkedin.com/in/____davidkarlsen>
<http://www.linkedin.com/in/____davidkarlsen
<http://www.linkedin.com/in/__davidkarlsen>>
<http://www.linkedin.com/in/____davidkarlsen
<http://www.linkedin.com/in/__davidkarlsen>
<http://www.linkedin.com/in/__davidkarlsen
<http://www.linkedin.com/in/davidkarlsen>>>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
<http://sberyozkin.blogspot.com/>
--
--
David J. M. Karlsen -
http://www.linkedin.com/in/____davidkarlsen
<http://www.linkedin.com/in/__davidkarlsen>
<http://www.linkedin.com/in/__davidkarlsen
<http://www.linkedin.com/in/davidkarlsen>>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
<http://sberyozkin.blogspot.com/>
--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen