Hi,
I have a webservice with one @WebMethod (say Method#1) . I have a need to add another @WebMethod (say Method #2) where I need most of the code that I had placed inside Method #1.
I have 2 ways to do this
a) Call Method#1 inside Method#2 and then proceed with additional code for Method#2
b) Move the common code into a private method and have both Method#1 and Method#2 use the common logic.
I am not comfortable using (a) because of calling one public @WebMethod from another public @WebMethod just to reuse code
Please advice if I can use (b) over (a) or any other better way of doing this
Regards
Ram
I have a webservice with one @WebMethod (say Method#1) . I have a need to add another @WebMethod (say Method #2) where I need most of the code that I had placed inside Method #1.
I have 2 ways to do this
a) Call Method#1 inside Method#2 and then proceed with additional code for Method#2
b) Move the common code into a private method and have both Method#1 and Method#2 use the common logic.
I am not comfortable using (a) because of calling one public @WebMethod from another public @WebMethod just to reuse code
Please advice if I can use (b) over (a) or any other better way of doing this
Regards
Ram