Hi,
I have a form with three search fields. I have created a webservice to accept these parameters and retrieve data from a SQL Server database. I would like the search fields to be optional, where the user can enter 0-3 parameters to filter their data. The web service chokes when all 3 are not passed in. I tried the following and haven't had much success:
1. Tried using optional byval in my webmethod, but this is not allowed for webmethod functions.
2. Created an overloaded webmethod to accept different combinations of the parameters. In VS.net, it doesn't allow you to create this unless you have a different MessageName defining your webmethod. Infopath forces you to choose which method you want to use, so this isn't working for me.
Has anyone run into this before? This feature is easily available if I connect my form directly to the database, but I've been reading that I should use web services to receive/submit data. Finally, if I am creating a web service that retrieves data from two related tables, what is the best way to go about doing that? I tried the SQLDataAdapter wizard, but it gets very messy when I start introducing parameters. Any help or direction to a good example would be greatly appreciated. Thanks!