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]>

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:ws:customer:v1}customerCreateRequest"
) CustomerCreateRequest customerCreateRequest ) {

And have also cleaned up the config.


2013/10/7 Sergey Beryozkin <[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}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>





--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen






--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to