On 02/12/11 17:15, laksu wrote:
I am using XMLSpy for playing with XMLs and XSDs.

The following is supplied by XMLSpy into the root element of my XML, when I
choose "Assign Schema" from its menu:

<products xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="listProducts.xsd">
    <product id="1658" ...

and my XSD starts like that:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
        <xs:element name="products">
                <xs:complexType>....

I got that by asking XMLSpy to generate.

I added XSISchemaLocation annotation which you can add to a given resource method and reference a schema using a relative path, example:
@XSISchemaLocation("schemas/products.xsd")

This will be resolved against a web application context path.
It is also possible to hide "schemas" part by additionally configuring JAXbElementProvider, I'll send a link to the docs a bit later on

Cheers, Sergey


Thanks,
Levent

--
View this message in context: 
http://cxf.547215.n5.nabble.com/automatic-schema-generation-for-a-RS-method-tp5033048p5042635.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com

Reply via email to