Very interesting. So basically you define a service something like this.

@WebService // jaxws annotation. 
@Path("json") // jaxrs annotation.
public class CustomerService implements CustomerSericePortType {

    @POST // jaxrs annotation.
    @Consumes({MediaType.APPLICATION_JSON}) // jaxrs annotation.
    @Produces({MediaType.APPLICATION_JSON}) // jaxrs annotation.
    @Path("getcustomer")
    public CustomerResponse authenticate(CustomerRequest body) {
        ...
    }
    
}

Tim

-----Ursprüngliche Nachricht-----
Von: Mark Streit [mailto:[email protected]] 
Gesendet: Mittwoch, 10. Oktober 2012 14:40
An: [email protected]
Betreff: Re: JSON Support JAX-WS

We tried exactly that... Having JAX-WS and JAX-RS annotations on same
service implementation class and it worked.   (Assuming that is what Sergey
is suggesting).

http://cxf.apache.org/docs/jax-rs.html#JAX-RS-CombiningJAXWSandJAXRS

Mark
On Oct 10, 2012 7:22 AM, "Sergey Beryozkin" <[email protected]> wrote:

> On 10/10/12 11:28, Timothy Canavan wrote:
>
>> What is the recommended was to provide JSON support for an existing 
>> contract first JAX-WS web service which uses JAXB for binding.
>>
>> Should I simply use JAX-RS or integrate JSON into the JAX-WS stack 
>> somehow.
>>
>>
> Have a look at 
> systests/transports/src/test/**java/org/apache/cxf/systest/
> **servlet/restful_service.xml,
>
> alternatively, you can indeed introduce a JAX-RS endpoint and share 
> the same service bean between JAXWS and JAXRS endpoints
>
> Cheers, Sergey
>
>
>> Tim
>>
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>

Reply via email to