|
7.7. Link a Form to a Web ServiceAnother way to use a shared data source with InfoPath is to link the form to a web service. You can't just use any web service with InfoPath. If you try to use the Amazon or Google web services, for example, you'll get the error shown in Figure 7-34. Figure 7-34. InfoPath rejecting an RPC-encoded web serviceThe InfoPath SDK installs these examples that demonstrate how to write a web service that can be used by InfoPath forms:
Note: Web services provide a way to link InfoPath forms to non- Microsoft databases. Tip: To install the InfoPath SDK web service examples locally, you must be running Windows XP Pro with IIS installed. 7.7.1. How to do itThe SDK has pretty good instructions on how the sample web services work and how to use them from InfoPath. I won't repeat those here, but to make your life a little easier, I've installed those services at www.mstrainingkits.com/Excel and modified the sample forms to work with that location. This means that you can run the samples without installing the SDK (Figure 7-35). Figure 7-35. SDK web service sample (modified)In addition to changing the data source for the web service sample, I also:
7.7.2. How it worksThe SDK sample uses the InfoPathWebServiceSample.asmx web service as both a primary data source (to get the Order records) and as a secondary data source (to populate the Employee Name drop-down list). In this sample, the web service functions as an interface to the Northwind database (renamed infnwind.mdb, in this case). This approach allows developers to link forms to any type of data store, including Oracle or MySQL databaseswhich aren't directly supported by InfoPathand to access those data stores remotely over the Internet. It requires a fair amount of knowledge to create a web service, and there are some excellent books devoted to the subject. 7.7.3. What about...
|
|