How do I – Add an InfoPath Data Connection to consume the UserProfileService.asmx web service – Complete

Written by Cornelius J. van Dyk on . Posted in Blog

As we know, InfoPath forms have the ability to consume data from SharePoint’s User Profile Service Application through the SharePoint Web Services or to be more exact, through the UserProfileService.asmx web service specifically.  The question is how to do that?  It can be achieved by following a few simple steps as outlined below.

1.  From InfoPath, click the “Data” tab in the top menu.

2.  From the Data tab ribbon that opened, click “Data Connections”.

screenshot.615

3.  The “Data Connections” dialog window opens.

4.  There should be one data connection named “Main Data Connection” displayed already.

5.  Click the “Add” button to add a new connection.

screenshot.616

6.  The “Data Connection Wizard” appears.

7.  Select the “Create a new connection to:” radio button.

8.  Select the “Receive data” radio button.  NOTE:  These are usually set by default, but if they’re not selected on your form, select them.

9.  Click the “Next” button. 

screenshot.617

10.  Select the “SOAP Web service” radio button.  This should be the default value, but if it isn’t, select it.

11.  Click the “Next” button.

screenshot.618

12.  Now enter the location of the target service to be consumed in the edit box.  In our case, we are trying to consume the “UserProfileService.asmx” service which resides in the /_vti_bin/ virtual location off your current SharePoint site.  Simply copy the site URL of your site and append “/_vti_bin/UserProfileService.asmx” to it.  For example, if your site URL is http://www.crayveon.com/sites/SuperTeam/default.aspx, drop the page reference and append the above text to give you a value of http://www.crayveon.com/sites/SuperTeam/_vti_bin/UserProfileService.asmx which you enter into the edit box.

13.  Click the “Next” button.

screenshot.619

14.  InfoPath will connect to the web service and display the list of valid operations.

15.  Scroll down the list and locate the “GetUserProfileByName” operation and select it.

16.  Click the “Next” button.

screenshot.620

17.  On the parameter screen, simply click the “Next” button.

screenshot.621

18.  Ensure that the “Store a copy of the data in the form template” option is unchecked.

19.  Click the “Next” button.

screenshot.622

20.  On the next screen, you can specify the name you wish to give this data connection.  By default it will be called “GetUserProfileByName”, but you can change it if you’d like.

21.  Click the “Finish” button.

 screenshot.624

22.  The new data connection is now shown in the “Data Connections” dialog window.

23.  Click the “Close” button.

 screenshot.625

Now by simply using this data connection in your form, you have access to the vast array of data made available to you via SharePoint’s User Profile Service Application.

 



Cheers
C




image

Tags: , , ,

Cornelius J. van Dyk

Born and raised in South Africa during the 70's I got my start in computers when a game on my Sinclair ZX Spectrum crashed, revealing it's BASIC source code. The ZX had a whopping 48K of memory which was considered to be a lot in the Commodore Vic20 era, but more importantly, it had BASIC built into the soft touch keyboard. Teaching myself to program, I coded my first commercial program at age 15.

After graduating high school at 17, I joined the South African Air Force, graduating the Academy and becoming a Pilot with the rank of First Lieutenant by age 20. After serving my country for six years, I made my way back into computer software.

Continuing my education, I graduated Suma Cum Laude from the Computer Training Institute before joining First National Bank where my work won the Smithsonian Award for Technological Innovation in the field of Banking and Insurance. Soon I met Will Coleman from Amdahl SA, who introduced me to a little known programming language named Huron/ObjectStar. As fate would have it, this unknown language and Y2K brought me to the USA in 1998.

I got involved with SharePoint after playing around with the Beta for SharePoint Portal Server 2003. Leaving my career at Rexnord to become a consultant in 2004, I was first awarded the Microsoft Most Valuable Professional Award for SharePoint in 2005, becoming only the 9th MVP for WSS at the time. I fulfilled a life long dream by pledging allegiance to the Flag as a US citizen in 2006. I met the love of my life and became a private consultant in 2008. I was honored to receive my ninth MVP award for SharePoint Server in 2013.

Leave a comment

You must be logged in to post a comment.