Reputation: 119
Can some one tell me the where should be @WebMethod
used and where @Path or @RequestMapping
should be used?
Recently I came through a code where @webmethod
is used, till now I have been using @path and @requestmapping
for implementing my webservices.
Well, the code with Webmethod was using SOAP webservices.
Is it something to do with SOAP or REST? or Java or J2EE?
I have tried googling, but no success till now.
@WebMethod(operationName = "GetPendingrequest")
public abstract ERxPendingRequestsCounts getERxPendingCountsForProvider(@WebParam(name = "pvid") BigDecimal pvid)
throws SystemFault,SecurityFault, IllegalArgumentFault;
Upvotes: 0
Views: 519
Reputation: 1400
@Path
is a JAX-RS notation. @WebMethod
is the standard JAX-WS notation that tells that this particular method should be exposed as a public operation of the WebService.
Note: JAX-RS is specification that deals with RESTful interfaces while JAX-WS is the corresponding one for SOAP.
You can find more details on standard JAX-WS annotations here: https://docs.oracle.com/cd/E13222_01/wls/docs92/webserv/annotations.html#wp1040606
Upvotes: 4