Hi
I have a interface method declared as mentioned below. This is
combination of both SOAP and REST. So, client can be doing either SOAP
call or REST call. How do I know in the implementation of this method
whether the client is doing SOAP call or REST call? If there is some
clue in-side the implementation, then, I can throw either
MyApplicationFault(if it is SOAP client call) or WebApplicationException
(if it is REST call). I thought of having both MessageContext (for REST
case) and WebServiceContext(for SOAP case) annotated setters inside the
implementer class. is it a fair assumption that when in SOAP-call
MessageContext would be null OR in REST-call..WebServiceContext be null?
I read in the CXF documentation that this is not the case. The both
objects would not be null(s) for either of the case. How to solve this
riddle? I read in some other thread that I can do ExceptionMapper. I
thought of doing my own Spring AOP and handle this..if I have some clue
in implementing method whether the caller is doing SOAP call or REST
call. Any help is appreciated.
@WebMethod
@GET
@Path("/{id}")
@Consumes("*/*")
Book getBook(@PathParam("id") @WebParam(name = "id") Long id) throws
MyApplicationFault, WebApplicationException;
Please note that the above method is throwing MyApplicationFault (for
SOAP) and WebApplicationException (for REST)
Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected] <mailto:[email protected]>