Preparations for Deploying an XML Web Service

 < Day Day Up > 

InfoPath is designed to be used not only to connect to relational databases such as Microsoft Access and Microsoft SQL Server, but also to provide access to specified types of XML Web services.

There are many potential uses of InfoPath with XML Web services. Using InfoPath 2003 with XML Web services is very straightforward once everything is set up correctly.

To maximize the likelihood that you can work through this chapter, I will use the Web services examples included in the InfoPath 2003 Software Development Kit, which can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyID=351f0616-93aa-4fe8-9238-d702f1bfbab4&displaylang=en. The version of the SDK I used is dated September 24, 2003.

The system requirements for the Web services form templates in the SDK are as follows :

  • Windows 2000 Server (with the appropriate Service Packs), Windows XP Professional (with Service Pack 1), or Windows 2003 Server with Internet Information Services (IIS) installed

  • Microsoft .NET Framework version 1.0 or later

  • Microsoft SQL Server 2000 (with the appropriate Service Packs)

  • InfoPath 2003

BOOKS ABOUT CREATING XML WEB SERVICES

This chapter is about using XML Web services with InfoPath 2003. It is not about the creation of XML Web services. Among the books available on creating XML Web services using the .NET Framework is Microsoft .NET XML Web Services Step by Step (Microsoft Press).


If you plan to use the email attachment functionality, you will also need Microsoft Office Outlook 2003 (or an equivalent email client that supports attachments) and the Microsoft SMTP server running on IIS.

Installing Internet Information Services

To run the InfoPath SDK XML Web services examples, you must have IIS installed on the local development machine or on an appropriate server. In Windows XP Professional and Windows 2003 Server, IIS is not installed by default.

To check whether you have IIS installed, follow these steps:

  1. Go to Control Panel and select Add or Remove Programs.

  2. In the Add or Remove Programs window, click Add/Remove Windows Components in the left side panel.

  3. Scroll down to Internet Information Services (IIS) in the Windows Components Wizard window and ensure that its check box is checked (see Figure 8.1, which shows the appearance on Windows XP).

    Figure 8.1. Selecting Internet Information Services.

    graphics/08fig01.jpg

  4. Click the Details button. The Internet Information Services (IIS) window opens (see Figure 8.2).

    Figure 8.2. The Internet Information Services (IIS) window.

    graphics/08fig02.gif

  5. Ensure that the SMTP Service and World Wide Web Service check boxes are checked (plus any others that you want). Click OK, and then click Next in the Windows Components Wizard window; the selected components will be installed. If all the necessary components are already checked as installed, you can cancel out of the wizard.

    On Windows 2003, you must open the Internet Information Services Manager, go to the Web Services Extensions node, and allow ASP .NET pages to run.

If IIS has been installed correctly and doesn't already have a configured Web site or Web service, typing http:// myServerName / or http://localhost/ in Internet Explorer will cause a default page to be displayed by IIS. Figure 8.3 shows the IIS 5.1 default page.

Figure 8.3. The default Web page for IIS 5.1.

graphics/08fig03.jpg

If IIS was already installed and used for other purposes, the default Web page will likely have been replaced by a Web page, an ASP Web page, an ASP .NET Web page, or a Web service.

If you installed IIS after you installed the .NET Framework, you will have to register the ASPNET user account. You do so by running the utility aspnet_regiis.exe from the command line. Open a Command window and navigate to the directory where the utility is stored. On Windows XP, you can expect to find aspnet_regiis.exe in c:\Windows\Microsoft.NET\Framework\v1. versionNumber . If you are unsure of the location of aspnet_regiis.exe on your system, it might be quickest to do a search for the filename and then navigate to the appropriate directory.

At the command prompt, after you have navigated to the correct directory in the Command window, type

  aspnet_regiis.exe -I  

to register the ASPNET account. Messages will be displayed indicating the progress and completion of the registration.

Installing and Configuring the SDK

The InfoPath SDK is downloaded as a single MSI file, InfoPathSDK.msi . Download the file to a suitable location on your hard disk, locate the file, double-click it, accept the Microsoft licensing agreement, and follow the onscreen instructions to install the SDK. If the SDK installs correctly, you will see a message like the one shown in Figure 8.4. In addition, if installation has been successful, the InfoPath SDK will be accessible via the All Programs (in Windows XP) menu.

Figure 8.4. Installation of the SDK has completed successfully.

graphics/08fig04.gif

The InfoPath SDK includes a configuration utility that carries out several configuration steps necessary to use the InfoPath form templates provided as samples. To access the configuration utility on Windows XP Professional, click the Start button and select All Programs, Microsoft Office 2003 Developer Resources, Microsoft InfoPath 2003 SDK, Setup, Samples Setup. The configuration utility opens (see Figure 8.5).

Figure 8.5. The InfoPath SDK configuration utility.

graphics/08fig05.jpg

The configuration utility carries out four tasks , and its interface is divided into four corresponding sections:

  • Creating virtual directories on an IIS server

  • Creating connection strings for database access

  • Modifying the sample developer form templates, if you altered the default values provided by the configuration utility

  • Setting up the Common Language Runtime sample form template

The top section of the configuration utility allows creation of IIS virtual directories using IIS 5.0 (Windows 2000), IIS 5.1 (Windows XP Pro), or IIS 6.0 (Windows 2003 Server).

The Server Name text box will typically show the name of your local machine by default, assuming it has IIS installed. If you intend to use IIS on another machine on your network, edit the Server Name text box accordingly .

By default, the configuration utility creates a root directory called InfoPathSDK for InfoPath SDK XML Web services. If you want to change the name of the directory, edit the Logical Name text box in the configuration utility.

After the contents of the Server Name and Logical Name text boxes are correct, click the Execute button in the top section of the configuration utility. The Status, which is visible to the left of the Execute button, will change from Not Completed to In Progress, and finally to Complete.

The second section of the InfoPath SDK configuration utility allows you to test the connection to the Northwind SQL Server sample database. Check whether the Server Name text box contains the desired server name (no change is needed if SQL Server is installed on the local machine as a default instance) and that the authentication to SQL Server is appropriate to the way that you have SQL Server set up. The Connection String text box is likely to contain a correct, automatically generated connection string, so don't fiddle with it unless you are sure it needs to be changed and you understand what you are doing. Click the Test Connection button. If the connection is correctly specified, the Status will change very rapidly from Not Completed, to In Progress, to Complete.

If you receive an error message when testing the SQL Server connection, be sure to confirm that the SQL Server is running, particularly if you use it only occasionally for development purposes and haven't set it to run when the operating system starts.

If you have changed the Server Name and/or the Logical Name text boxes in the first section of the configuration utility, you will need to modify the sample forms using the third section of the configuration utility. Click the Execute button, and the Status will change from Not Completed to Complete, assuming that all is in order. The remainder of this chapter assumes that the server is the local machine.

Configuring SQL Server

For the Web service sample form templates to work correctly, SQL Server 2000 needs to be configured to allow both Windows authentication and SQL Server authentication. To check the security configuration for the relevant SQL Server instance, follow these steps:

  1. Open SQL Server Enterprise Manager (see Figure 8.6). To access Enterprise Manager on XP Professional on a local machine, click the Start button, select All Programs, select Microsoft SQL Server, and select Enterprise Manager.

    Figure 8.6. SQL Server 2000 Enterprise Manager.

    graphics/08fig06.gif

  2. Click the node beside Microsoft SQL Servers, click the node beside SQL Server Group, and then click the node beside the SQL Server instance you are using (in my case, it is (local) ).

  3. Right-click the name of the SQL Server instance and select Properties from the menu. When the SQL Server Properties (Configure) window opens, select the Security tab (see Figure 8.7).

    Figure 8.7. The Security tab of the SQL Server Properties (Configure) window.

    graphics/08fig07.gif

  4. Under Authentication, select the SQL Server and Windows option. Click OK.

  5. If you have had to change the authentication, you will be informed that you need to stop and restart the SQL Server. If you are not working with a production SQL Server, stop and restart the SQL Server instance.

SECURITY IN SQL SERVER

The configuration described is straightforward to set up for development testing. For production, be sure to configure SQL Server to achieve the appropriate level of security.


 < Day Day Up > 


Microsoft Office InfoPath 2003 Kick Start
Microsoft Office InfoPath 2003 Kick Start
ISBN: 067232623X
EAN: 2147483647
Year: 2004
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net