Design a form connected to a Web service
When you design a new form that is connected to a Web service, Microsoft Office InfoPath 2003 builds a data structure for your form based on the operations of the Web service. The resulting form can then be used to submit data to and query the Web service. You can work with the form in many of the same ways as when you design a new blank form
You can design forms that receive data from a Web service, submit data to a Web service, or do both.
Note InfoPath cannot connect to Web service operations that use remote procedure call (RPC) encoding. Only document literal encoding is supported.
Design a form that receives data from a Web service
- On the File menu, click Design a Form.
- In the Design a Form task pane, click New from Data Source.
- On the first page of the Data Source Setup Wizard, click Web service, and then click Next.
- On the second page of the Data Source Setup Wizard, click Receive data, and then click Next.
- On the third page of the wizard, enter the location of the WSDL for the Web service, and then click Next.
Note If you want to search a UDDI (Universal Description, Discovery, and Integration) server for the Web service, click Search UDDI, enter the UDDI server you want to search, specify whether you want to search by provider or by the services that are provided, and enter a keyword to search for.
- If requested, you must specify sample values so that InfoPath can query the Web service and collect more information about it.
- Select a parameter, and then click Set Sample Value.
- In the Set Value dialog box, type the value for the parameter.
- On the next page of the wizard, specify the Web service operation that you want to provide the data for your form, and then click Next.
- In the Summary box, make sure that the information matches the options you specified.
- At the end of the wizard, InfoPath creates two views for your form: a query view and a data entry view. Users use the query view to enter queries for the Web service. When they run the query, the data from the Web service is displayed in the data entry view. To choose the view you want to design first, do one of the following:
- To start by designing the query view, in which users can enter values with which to query the Web service, click Design query view first, and then click Finish.
- To start by designing the data entry view, in which users can enter and edit information to save as form data, click Design data view first, and then click Finish.
- To begin adding controls to the form, right-click a field or group in the Data Source task pane, and then, on the shortcut menu, click the control you want to insert. Use only query fields in the query view and only data fields in the data entry view.
Design a form that submits data to a Web service
- On the File menu, click Design a Form.
- In the Design a Form task pane, click New from Data Source.
- On the first page of the Data Source Setup Wizard, click Web service, and then click Next.
- On the second page of the Data Source Setup Wizard, click Submit data, and then click Next.
- On the third page of the wizard, enter the location of the Web service, and then click Next.
Note If you want to search a UDDI (Universal Description, Discovery, and Integration) server for the Web service, click Search UDDI, enter the UDDI server you want to search, specify whether you want to search by provider or by the services that are provided, and enter a keyword to search for.
- On the next page of the wizard, specify the Web service operation that you want to submit your form data to, and then click Next.
- In the Summary box, make sure that the information matches the options you specified.
- To begin adding controls to the form, right-click a field or group in the Data Source task pane, and then, on the shortcut menu, click the control you want to insert.
Design a form that receives data from and submits data to a Web service
- On the File menu, click Design a Form.
- In the Design a Form task pane, click New from Data Source.
- On the first page of the Data Source Setup Wizard, click Web service, and then click Next.
- On the second page of the Data Source Setup Wizard, click Receive and submit data, and then click Next.
- On the third page of the wizard, enter the location of the WSDL for the Web service that you want to receive data from, and then click Next.
Note If you want to search a UDDI (Universal Description, Discovery, and Integration) server for the Web service, click Search UDDI, enter the UDDI server you want to search, specify whether you want to search by provider or by the services that are provided, and enter a keyword to search for.
- If requested, you must specify sample values so that InfoPath can query the Web service and collect more information about it.
- Select a parameter, and then click Set Sample Value.
- In the Set Value dialog box, type the value for the parameter.
- On the next page of the wizard, specify the Web service operation that you want to provide the data for your form, and then click Next.
- On the next page of the wizard, enter the location of the Web service that you want to submit data to, and then click Next. This Web service can be the same as the one that you receive data from.
- On the next page of the wizard, specify the Web service operation to which you want to submit your form data, and then click Next.
- If requested, you must specify which part of your form provides the data for the parameters that the Web service operation requires.
- Select a parameter, and then click Modify.
- In the Select a Field or Group dialog box, select the field in your form that you want to submit to the parameter.
- In the Summary box, make sure that the information matches the options you specified.
- At the end of the wizard, InfoPath creates two views for your form: a query view and a data entry view. Users use the query view to enter queries for the Web service. When they run the query, the data from the Web service is displayed in the data entry view. Editing the data in the data entry view and then submitting it modifies the Web service data. To choose the view you want to design first, do one of the following:
- To start by designing the query view, in which users can enter values with which to query the Web service, click Design query view first, and then click Finish.
- To start by designing the data entry view, in which users can enter and edit information to submit to the Web service, click Design data view first, and then click Finish.
- To begin adding controls to the form, right-click a field or group in the Data Source task pane, and then, on the shortcut menu, click the control you want to insert. Use only query fields in the query view and only data fields in the data entry view.
Note Because the data structure for the form must match the Web service, the following limitations apply:
- You cannot automatically create the data source when inserting controls.
- You cannot modify existing fields or groups in the data source.
- You can only add fields or groups to the root group in the data source.