If you want your users to submit their form data to a Web service, you can add a submit data connection to your form template as a secondary data connection. Depending on the types of data that the Web service accepts, you can configure the submit data connection to submit either the data in a specified field, the data in all of the fields in a group, or all of the data in the form. After you add the submit data connection, you configure the form template to allow users to submit their form data to the Web service. As a result, Microsoft Office InfoPath adds a Submit button to the Standard toolbar and a Submit command to the File menu on the form. You can also customize the submit options for your form template in the following ways:
- Change the text that appears on the Submit button on the Standard toolbar and the Submit command on the File menu.
- Change the keyboard shortcut for the Submit button on the Standard toolbar and the Submit command on the File menu.
- Create custom messages to display to your users when they submit their forms.
- Specify whether to leave the form open, close the form, or open another blank form after the form is submitted.
Add the submit data connection- On the Tools menu, click Submit Options.
- In the Submit Options dialog box, select the Allow users to submit this form check box.
- Click Send form data to a single destination, and then click Web service in the list.
- Click Add.
- In the Data Connection Wizard, type the location of the Web service where your users will submit their data, and then click Next. Tip If you want to search a Universal Description, Discovery, and Integration (UDDI) server for a Web service, click Search UDDI, enter the UDDI server that you want to search, specify whether you want to search by provider or by the services that are provided, enter a search keyword, and then click Search. Web services that match your search keyword will appear in the Search result list.
- On the next page of the wizard, in the Select an operation list, click the Web service operation that you want to use to receive the form data, and then click Next.
- On the next page of the wizard, to select what data in the form to submit for each parameter in the Web service, do one of the following: Submit the data in a field or group
- In the Parameters list, click the Web service parameter that will receive the data from the form.
- In Parameter options, click Field or group.
- Click Modify .
- In the Select a Field or Group dialog box, click the field or group whose data you want to submit, and then click OK.
- In the Include box, click Text and child elements only to submit just the data in this field and the child elements of the field or group, or click XML subtree, including selected element to submit the field name, the data in the field, and the child elements in the selected group or field.
Submit all of the data in the form
- In the Parameters list, click the Web service parameter that will receive the data from the form.
- Under Parameter options, click Entire form (XML document, including processing instructions).
Submit the data as a string
- In the Parameters list, click the Web service parameter that will receive the data from the form.
- Under Parameter options, click Entire form (XML document, including processing instructions).
- Select the Submit data as a string check box. Note Typically, you select this check box to submit digitally signed data. In most cases, clear this check box.
Technical details about Microsoft ADO.NET DataSet objects If the Web service requires an ADO.NET DataSet object, select a DataSet node when you configure this data connection. If you use any other type of node for a data connection to a Web service that requires an ADO DataSet, the submit action will fail. - Click Next.
- On the next page of the wizard, in the Enter a name for this data connection box, type a descriptive name for this submit data connection.
- To change the name of the Submit button that appears on the Standard toolbar and the Submit command that appears on the File menu when users fill out the form, type the new name in the Caption box in the Submit Options dialog box. Tip If you want to assign a keyboard shortcut to this button and command, type an ampersand (&) before the character that you want to use as a keyboard shortcut. For example, to assign ALT+B as the keyboard shortcut for the Submit button and command, type Su&bmit.
- Verify that the information is correct in the Summary section, and then click Finish.
- To allow users to use the Submit command or the Submit button on the Standard toolbar when they fill out your form, select the Show the Submit menu item and the Submit toolbar button check box.
- By default, after users submit a form, InfoPath keeps the form open and displays a message to indicate if the form was successfully submitted. To change this default behavior, click Advanced, and then do one of the following:
- To close the form or create a new blank form after the user submits a completed form, click the option that you want in the After submit list.
- To create a custom message to indicate if the form was successfully submitted, select the Use custom messages check box, and then type your messages in the On success and On failure boxes. Tip Use a message in the On failure box to tell users what to do if they cannot submit their form. For example, you can suggest that users save their form and contact someone for further instructions.
- If you do not want to display a message after the user submits a form, clear the Show success and failure messages check box.
|