Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Webservice overloading  RSS feed

 
Venkatesh Govindaraju
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell me like how to use overloading and interface concepts in Webservice.
 
Kaustabh Singha Roy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch Venkatesh.

Overloading the web service methods is not difficult. With Axis 1.4 at least it is fairly simple. If there are two overloaded methods in the service like below...

public String test(String firstName, String lastName) throws RemoteException
public String test(String name) throws RemoteException

Then a request like this
http://localhost:8080/services/testService?method=test&name=<name>
will invoke the second method

and a request like
/services/testService?method=test&firstName=<first_name>&lastName=<last_name>
will invoke the first method.

The resolution is done by Axis.

Hope this is helpful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!