When creating forms one thing users have become accustomed to is having dynamic forms with features such as cascading drop down lists. Microsoft’s latest addition to the Office suite, InfoPath, provides the means to swiftly create structured data forms and with a little code some of these dynamic capabilities can also be implemented.
I tried to replicate some of the functionality I was able to provide in ASP.NET forms using Microsoft InfoPath SP1. Since it is still a new product I found resources to be scarce, so I hope this article will help others adopt and use InfoPath meaningfully in a shorter time.
One of the more useful techniques is to know how to pass parameters to a web service at runtime. This technique lends itself well to creating dependent drop down lists and runtime lookups or queries. This example will demonstrate how to set an InfoPath form’s secondary data source web service parameter using managed code and uses the following:
-
Microsoft Office InfoPath 2003 Service Pack 1 (SP1) Preview
-
InfoPath 2003 Toolkit for Visual Studio .NET
-
Microsoft Visual Studio .NET 2003 (1.1 Framework)
-
Microsoft Visual C#
-
Web service running on IIS 6.0