Kit Kai's Tech Blog

Blog about SharePoint

This Blog

Syndication

Search

Tags

News



  • Want to be notified when new posts are available? Click the icon below for more information on how to subscribe.

    Blog Flux MapStats: Stats and Counter for Kit Kai's Tech Blog Subscribe to Kit Kai's Tech Blog

    Locations of visitors to this page Add to Technorati Favorites

Community

Email Notifications

Archives

Sharepoint / CMS Blogs

MVPs', Leads' & RDs' Blogs

Singapore Usergroups

Overseas Usergroups

About Me

Consuming Web Services in InfoPath Part 3: Designing the Form

Now for the form. Let's not focus on the design of the form here... 

  1. Create 5 fields. 4 of the fields are whole number fields, with default value = 0, with the following name: Copper, Aluminium, Lead, Ferrous. 1 of the field are decimal field with the name, Total.
  2. Drag and drop the 5 fields into the form
  3. Right click each whole number fields, and select [Rules]
  4. Click [Add]
  5. Give the rule a name

Setting the parameters 

Add the first action. This action is to set the parameter of the Web Service.

  1. Click [Add Action]
  2. Select [Set a field's value]
  3. Click the icon besides the [field]
  4. In the [Data Source] dropdown, select "MetalExchange (Secondary)"
  5. Expand the [queryFields], and select "CopperWeight"
  6. Click [OK]
  7. Click on the icon besides the [value] field
  8. Click [Insert FIeld or Group]
  9. In the [Data Source] dropdown, select "Main"
  10. Select "Copper"
  11. Click [OK]
  12. Click [OK]
  13. Click [OK]

Repeat the above steps for the rest of the three metals

Now, your rules screen should look like this.

We are not done yet...

Executing the Web Service

  1. Click on [Add Action]
  2. Under [action], select "Query using a data connection"
  3. Make sure your data connection is selected in [Data connection]
  4. Click [OK]
  5. Click on [Add Action] again
  6. Select [Set a field's value]
  7. Click the icon besides the [Field] field
  8. Make sure the [Data Source] is "Main"
  9. Select "Total"
  10. Click [OK]
  11. Click the icon besides the [Value] field
  12. Click on [Insert Field or Group]
  13. Under [Data Source] select "MetalExchange (Secondary)"
  14. Expand [dataFields]
  15. Select "GetPriceResult"
  16. Click [OK]
  17. Click [OK]
  18. Click [OK]

  1. Click on [OK]
  2. Click on [OK]

Admin publish the form, and do all the necessary steps to allow you to fill up an instance of the form. But you will soon realise that access is denied to the data connection file...

 

Published Monday, July 09, 2007 11:16 PM by kitkai

Comments

# Four part consuming web services in InfoPath article@ Tuesday, July 10, 2007 12:40 AM

I've quickly put together a 4 part series to illustrate how to consume web services in your browser-enabled