Hi Sergey,

just to let you know, my employer has given me permission to submit my
XMLBean providers to the CXF project.

I've got two classes so far that produce and consume XML and JSON from
XMLBeans. I'm also going to be developing a provider class next week
to provide ATOM feeds.

If you still think they'd be of use I'd be happy to submit a patch as
a starting point for XMLBean support within CXF.

Brad.

On Thu, Apr 24, 2008 at 4:37 PM, Sergey Beryozkin
<[EMAIL PROTECTED]> wrote:
> Hi Brad
>
> This is good.
>
>> It looks to me like the included JSON
>> provider is essentially the JAXB provider with some Jettison mapping.
> Yes, exactly.
>
> There's also a Json support for Atom feeds/entries is available (
> courtesy of Abdera)
>
>> I'm going to have a go at creating a JSON provider for XMLBeans
>> sources to see if that theory checks out.
>
> Please do. If it works out ok for you then may be you might want to
> consider contributing such a provider to CXF...
>
> Cheers, Sergey
>> Hi Sergey,
>>
>> thanks for that advice, exactly what I needed to know. I've now got a
>> basic XMLBeans provider working.
>>
>> We're also interested in being able to provide JSON based services
>> from our XMLBeans data objects. It looks to me like the included JSON
>> provider is essentially the JAXB provider with some Jettison mapping.
>> I'm going to have a go at creating a JSON provider for XMLBeans
>> sources to see if that theory checks out.
>>
>> Brad.
>>
>> On Wed, Apr 23, 2008 at 6:14 PM, Sergey Beryozkin
>> <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>> Hi
>>>
>>> If you're using Spring then please have a look at
>>>
>>> trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml.
>>> something like this will do :
>>> <jaxrs:server id="bookservice" address="/">
>>>
>>>
>>>
>>>
>>>     <jaxrs:serviceBeans>
>>>
>>>
>>>     <ref bean="petstore" />
>>>
>>>     <ref bean="bookstore" />
>>>   </jaxrs:serviceBeans>
>>>
>>>    <jaxrs:entityProviders>
>>>
>>>
>>>        <bean class="org.apache.cxf.systest.jaxrs.BadgerFishProvider" />
>>>   </jaxrs:entityProviders>
>>>  </jaxrs:server>
>>>
>>> Now, Jersey and other JAX_RS implementation would pick up the provider
>>> from
>>> the classpath, just annotating a custom provider with @Provider
>>> annotation
>>> would be sufficient. CXF is not capable of doing it yet. I'm not actually
>>> sure I like very much the idea of scanning the class path, should be fine
>>> in
>>> the simple scenarious but might cause classpath-like clash issues if say
>>> multiple custom providers for a certain type like Atom Feed or JAXB are
>>> availbale on the classpath. That said, this is something CXF will likely
>>> support, it's one of those areas where a patch would also be welcome.
>>>
>>> If you don't do Spring then you can do
>>>
>>> JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
>>> sf.setResourceClasses(CustomerService.class);
>>> sf.setAddress(http://localhost:9000/);
>>> // add you custom provider
>>> List<?> providers = ...;
>>> provider.add(new CustomProvider());
>>> sf.setEntityProviders(listOfProviders);
>>>
>>> sf.create();
>>>
>>>
>>> Hope it helps, Sergey
>>>
>>>
>>> ----- Original Message -----
>>> From: "Brad" <[EMAIL PROTECTED]>
>>> To: <[EMAIL PROTECTED]>
>>> Sent: Wednesday, April 23, 2008 4:22 PM
>>> Subject: Re: Creating a REST service from a schema
>>>
>>>
>>>
>>> > Hi all,
>>> >
>>> > I've now created a simple custom provider for my XMLBeans classes as
>>> > suggest (similar to JAXBElementProvider).
>>> >
>>> > I'm now getting this error:
>>> >
>>> >    No message body writer found for response class : TestDocImpl
>>> >
>>> > I'm guessing that my provider hasn't been registered somewhere it
>>> > needs to be? I searched for references to JAXBElementProvider but
>>> > could only find one occurance in the constructor of
>>> > org.apache.cxf.jaxrs.provider,ProviderFactory. So, I added my provider
>>> > there but I think I need a few tips how to get it registered.
>>> >
>>> > Cheers,
>>> > Brad.
>>> >
>>> > On Tue, Feb 19, 2008 at 5:04 PM, Sergey Beryozkin
>>> > <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >>
>>> >> Hi Brad
>>> >>
>>> >>
>>> >> > I prefer the XML first approach and would like to build a RESTful
>>> >> > service which either can use my already generated XMLBeans classes
>>> >> > (prefered option) or generate JAXB java binding classes from my
>>> >> > schema.
>>> >>
>>> >> No problems for a JAXB option, it should work just fine. CXF
>>> >> JAXBElementProvider checks if @XMLRootAnnotation is present.
>>> >> Fox XMLBeans, a simple custom provider would need to be added. Perhaps
>>> >> we
>>> >> should have it supported by default. Barry has added a system test
>>> showing
>>> >> how to write a JSON BadgerFish JAX-RS Provider  (I was actually very
>>> >> surprised to find out BadgerFish is a real thing which lives in the
>>> Jettison
>>> >> project)
>>> >>
>>> >> Cheers, Sergey
>>> >>
>>> >>
>>> >>
>>> >>  > Hi,
>>> >> >
>>> >> > I'm interested in using the jax-rs support in CXF. From the examples
>>> >> > I've seen it appears that I'm required to take that Java first
>>> >> > approach and let JAXB take care of the Java to XML mapping. Is this
>>> >> > correct?
>>> >> >
>>> >> > I prefer the XML first approach and would like to build a RESTful
>>> >> > service which either can use my already generated XMLBeans classes
>>> >> > (prefered option) or generate JAXB java binding classes from my
>>> >> > schema.
>>> >> >
>>> >> > Is this possible? The important things here for me are to have the
>>> >> > schema dictate what the XML looks like and to have it as a REST
>>> >> > service. If its not possible using JAX-RS, does CXF have an
>>> >> > alternative method to achieve the desired results?
>>> >> >
>>> >> > Thanks,
>>> >> > Brad.----------------------------
>>> >> IONA Technologies PLC (registered in Ireland)
>>> >> Registered Number: 171387
>>> >> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
>>> >> Ireland
>>> >>
>>> >>----------------------------
>>> IONA Technologies PLC (registered in Ireland)
>>> Registered Number: 171387
>>> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>>>
>>>
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

Reply via email to