• Post Reply Bookmark Topic Watch Topic
  • New Topic

web service method with optional parameters

 
dale con
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!