What Sergey said. You are going to have different interfaces as one is a WSDL and one a WADL, re-using the types works like a charm though. That way you can model against the same dictionary and provide SOAP + XML, Rest + XML, Rest + JSON depending on request parameters and so on.
Further combining CXF with Camel makes this even simpler since you don't really have to implement the interfaces per se. /je On Aug 2, 2013, at 9:13 AM, Sergey Beryozkin <[email protected]> wrote: > Hi > On 02/08/13 16:02, James Green wrote: >> Is there a project on say GitHub that demonstrates serious use of both >> JAX-RS and JAX-WS with proper exceptions being reported by both interfaces? >> >> It's one thing reading from the documentation and very narrow examples but >> it would be very useful to read the sources of a major finished project to >> see how it's done. >> >> It would be nice to see such an example proving both styles of interface >> via one set of classes with associated parameters and responses and >> exceptions. > Using a single (Java) interface to represent both JAX-WS & JAX-RS endpoints > can be useful: > - as a proof of concept (ex, you have a SOAP endpoint, can the same service > bean used to support RS calls ?, etc) > - when you have a SOAP endpoint and you have a strict requirement to reuse it > for RS calls > > I'm saying it to suggest that really complex projects would likely have > independent interfaces, as sometimes it can be difficult to use the same > interface to represent different communication styles, or even to map non-WS > URI + body to WS interface parameters. > > That said: as far as as the exceptions are concerned - this is the easiest > part - for RS endpoint you just register one or few JAX-RS ExceptionMapper(s) > and map them to whatever HTTP status code is appropriate in a given context > > Cheers, Sergey >> >> Any suggestions? >> >> Thanks, >> >> James >> > >
