Step 3: Add address validation through a Web service

In this phase we'll use a 3rd-party Web service to perform an address validation function for our form.

As a best practice, we first recommend first testing the Web service. You can do this by:

  1. Creating a new form in InfoPath.
  2. Adding the Web service to the form.
  3. Testing the form to ensure the service works.

In this case we're using a Web service called Address Doctor, and we've already verified that it works correctly.

Here we are importing the Web Service into Winshuttle Designer.

 

Here we're configuring the Web service and assigning it a group/name.

Remember that the Group name becomes the folder name in which the fields will be listed in InfoPath.

 

The field mappings for the Address Doctor Web Service.

Click Generate InfoPath Form to output the folder/fields for use in InfoPath.

 

The fields as output and shown in InfoPath.

 

Now, we'll map the fields and create a button to call the Address Doctor Web Service.

 

 

Here we are setting field properties.

For example, if the Web Service requires a House Number entry (input), we must map our corresponding form field House_Number to it.

 

The last part of this overall step is creating a rule to map output values correctly after the Correct Address button is clicked.

Our InfoPath rule is shown at right. The rules are triggered by the error code field (when the field value changes).

As a final measure, we add an error section in the debug section of the form, in case any errors are returned by the Web Service Call.

After all values are set correctly, the error code value is reset to 999.

 

 

 

 

As a final step, we output the form and test it again.