< Day Day Up > |
Two XML Web service sample form templates are supplied with the InfoPath SDK. We will briefly look at using each of these in turn . The Web Service Developer Form TemplateThe first sample is called the Web Service Developer Sample. To open it in design mode, open the Design a Form task pane and select the On My Computer option in the Open a Form in Design Mode section. The Open in Design Mode window opens. Navigate to the c:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office InfoPath 2003 SDK\Samples\WebSvc directory. (Adjust the path if you chose a drive other than drive C : to install the SDK.) Highlight the WEBSVC.XSN InfoPath form template, and click the Open button. The form template opens in design mode (see Figure 8.8). Figure 8.8. The WEBSVC.XSN form template in design mode.
Click the Preview Form button in the toolbar, and the form opens in form-filling mode (see Figure 8.9). Figure 8.9. The WEBSVC.XSN form template in form-filling mode.
From the drop-down menu, select a name and click the Run Query button. The results of a sample query are shown in Figure 8.10. Figure 8.10. Results of a sample query.
A description of the methods of the XML Web service can be accessed at http://localhost/infopathsdk/infopathwebservicesample/infopathwebservicesample.asmx or at a URL modified for the server on which you chose to run the Web service. The WSDL description of the Web service can be accessed at http://localhost/infopathsdk/infopathwebservicesample/infopathwebservicesample.asmx?WSDL (see Figure 8.11). Figure 8.11. The WSDL description of the sample XML Web service.
The Web service sample also has an Order Information view to enter information for a new product (see Figure 8.13). Figure 8.13. The Order Information view of the sample XML Web service.
Configuring the Purchase Order SampleAssuming the proper configuration of Internet Information Services, the InfoPath SDK, and SQL Server has been carried out, you are ready to configure the Purchase Order sample form template. On Windows XP Professional, select Start, All Programs, Microsoft Office 2003 Developer Resources, Microsoft Office InfoPath 2003 SDK, Setup, Purchase Order Web Service Sample Setup. The InfoPath SDK Configuration: PO WebService Developer Sample window opens (see Figure 8.14). Figure 8.14. The InfoPath SDK Configuration: PO WebService Developer sample window.
Enter a user ID in the User Id text box and a password in the Password text box. A connection string is created automatically in the Your Connection String Is text box. Click the Execute button. If the connection is successful with the provided User ID and password, the Status, displayed to the left of the Execute button, will change to Complete. Finally, assuming that configuration of the Web Service was completed successfully, click the Execute button in the Update and Register the PO Web Service Form Templates section. If all is correct, the Status will change to Complete.
The first time you open the Purchase Order, it won't appear on the list of recently used forms. So, open the Fill Out a Form task pane, select More Forms in the Fill Out a Form section, and select the Custom Installed Forms tab of the Forms window (see Figure 8.15). Figure 8.15. The Custom Installed Forms tab of the Forms window.
Select the Purchase Order form. Figure 8.16 shows how a developer with a taste for seafood might fill in the form. Figure 8.16. The Purchase Order form.
There is also an invoice component to the sample that you can take time to explore on your own. |
< Day Day Up > |