Preparing the InfoPath Environment
At this point you need to
have Microsoft InfoPath 2003 and Office 2003 Service Pack 1 (SP1)
installed on your computer. If your Office 2003 installation does not
have SP1 currently applied, you will be able to download it from:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9c51d3a6-7cb1-4f61-837e-5f938254fc47
You should also download the InfoPath 2003 SDK for further reference from:
http://www.microsoft.com/downloads/details.aspx?FamilyId=351F0616-93AA-4FE8-9238-D702F1BFBAB4
To verify Service Pack 1 has been installed, start InfoPath and click Help | About Microsoft Office InfoPath. The name of the latest service pack is printed next to the product’s version number.
Creating the InfoPath Document
InfoPath documents require an InfoPath template (.xsn),
designed in InfoPath, before they can create an InfoPath form template
and connect it to a Web service for data retrieval and submission.
Follow these steps to create an InfoPath template that will connect to
the Web service we just created:
1. | Launch Microsoft InfoPath 2003.
|
2. | On the left-hand side of the Fill Out a Form window, select Design a Form. If the Fill Out a Form window is not open, select File | Design a Form.
|
3. | From the Task Pane on the right-hand side, select New from Data Connection.
|
4. | In the Data Connection Wizard, select Web Service and click Next.
|
5. | Select Receive and submit data and click Next.
|
6. | Enter the Web service URL as http://localhost/McmsAuthoringWebService/authoring.asmx and click Next.
|
7. | For the Retrieve operation we must select the GetPosting operation and click Next.
|
8. | Click Next again. We use the same Web service address for the submit functionality, so again, click Next.
|
9. | Select the SavePosting operation and click Next.
|
10. | There
are several ways to submit data to a Web service. The entire XML
document can be submitted or a specific node can be selected. For this
form, we will submit only the GetPostingResult node that represents the result of the previous Web service call. Under Parameter options, click the
Modify button to open the Select a Field or Group dialog.
|
11. | Expand the dataFields node and the s0:GetPostingResponse node, then select the GetPostingResult node and click OK.
Depending on whether or not you have .NET 1.1 Service Pack 1 installed, the XML document namespace may be s0 or tns, because once the service pack is installed, VS .NET generates the Web service description (WSDL) file differently. Either s0 or tns will work in this solution.
|
|
12. | The submit data Field or group textbox will now be populated with an XPath query representing the path to the GetPostingResult node in InfoPath’s internal data structure.
|
13. | Click Next. Leave the data connection name as Main submit and click Finish.
|
The InfoPath template should now be created and the Data source window should now reflect the structure of the Web service.
Now let’s give this form a title. Click the Click to add title label and type in MCMS Authoring InfoPath Form. Select the text and make it bold.
Finally, we’ll enter some brief instructions below the title. Click anywhere on the Click to add form content label. In the space provided, enter This InfoPath form can retrieve and update existing MCMS postings.