During the design of an InfoPath form that will use the Web Service data source, a data structure is built on the operations selected within the Web Service. This results in forms that easily submit data or query data through a Web Service. Using a Web Service as the data source for an InfoPath form is essentially the same connection paradigm that we have done in previous chapters. Several restrictions are placed on the Web Service data source to guarantee compatibility with existing Web Services. When you re submitting forms directly to Web Services, it is important to remember that developers cannot modify existing fields and groups within the data source. However, they can modify additional fields within the root of the data source that are considered outside of the defined WSDL schema. InfoPath also allows you to do custom script based on standard HTTP submits.
CD-ROM InfoPath enables you to design a form that can directly submit its data to a Web Service. (This feedback service application is available on the companion CD-ROM, in \Code\Chapter 4\FeedBackServiceSetup\WebService\Setup.exe.) This provides developers with an easy-to-use data-collection form that provides a direct submit or receive from a Web Service. Figure 4.15 shows the selection screen for deciding the type of connection.
Once the type of submission is defined for the InfoPath form, we can either search UDDI or enter the Web Service URL to the published WSDL, as shown in Figure 4.16.
Once the data source is found, InfoPath then brings down the WSDL and determines the valid operations defined by the Web Service, as shown in Figure 4.17.
Once these are defined, the data source is populated and the form may be laid out within the sections for data entry, as shown in Figure 4.18.
It is important to understand that the individual data elements are appended to the default InfoPath namespace, as shown within the Properties tab in Figure 4.19.
By default, all submissions to a Web Service require that there be an available connection to the network and to the Web Service. However, InfoPath allows forms to be saved locally, and this can be used to provide offline access to data. This means that users can save either a completed or partially completed form to their local system. Once a connection is established to the server, users can then submit their forms to the specified Web Service.