IntelliJ Java IDE
The moose likes Web Services and the fly likes web service method with optional parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "web service method with optional parameters" Watch "web service method with optional parameters" New topic
Author

web service method with optional parameters

dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
hi all

I need to write a webservice method that takes optional parameters.

i want a method that will take a parameter, do some stuff based on the parameter entered. I also want the same method to be able to execute if no parameter is entered

e.g myMethod(myParam)
or
myMethod()

Is someone able to show me an example or tuorial?

Thanks for any help
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
WSDL1.1 identifies operations by name only (not message/parameter type) so Java-style method overloading is not possible.

The best you can do, AFAIK, is to allow for a null parameter (i.e., nillable="true") in your XML Schema.


-Tim
 
 
subject: web service method with optional parameters
 
Threads others viewed
Does Java offer any support for optional/default parameters?
generic Validation class with optional parameters
default arguments
Does Java offer any support for optional parameters?
Optional Parameters
IntelliJ Java IDE