Home > Uncategorized > SharePoint 2010: Get InfoPath Browser Enabled Forms To Work With Claims Aware Web Applications

SharePoint 2010: Get InfoPath Browser Enabled Forms To Work With Claims Aware Web Applications

In a recent upgrade from SharePoint 2007 to SP2010 we went from having a Web Application that used Classic Authentication to now using Claims Authentication (Claims Aware) in preparation for ADFS Federation in the future.  When doing so this broke the functionality of InfoPath Browser Enabled Forms from successfully executing SOAP Web Service calls.  This worked fine in the client but the browser enabled forms would not render the correct information when trying to populate fields while using the UserProfileService.asmx service and pulling in GetUserProfileByName properties.  To get InfoPath Browser Enabled Forms to Work with Claims Web Applications you have to do a few things.  Below are the steps needed to get this working in your environment.  The is lengthy with screenshots.

  1.  CREATE SECURE STORE SERVICE IN CENTRAL ADMIN
  2.  GENERATE NEW KEY
  3.  CREATE NEW APPLICATION ID FOR INFOPATH WEB SERVICES
    InfoPathWebServices_1
    InfoPathWebServices_3
    InfoPathWebServices_4
    InfoPathWebServices_5
  4. CREATE NEW INFOPATH 2010 FORM
    InfoPathWebServices_6
    DESIGN YOUR FORM, ADD A TEXTBOX CONTROL AND RENAME IT TO preferredName OR WHATEVER YOU CHOOSE
    InfoPathWebServices_7
    InfoPathWebServices_8
    CREATE DATA CONNECTION — GO TO “DATA” TAB IN THE RIBBON AND SELECT “FROM WEB SERVICE” THEN “FROM SOAP WEB SERVICE
    InfoPathWebServices_9
    CONNECT TO THE userprofileservice.asmx WEB SERVICE

    InfoPathWebServices_11
    SCROLL DOWN AND SELECT THE getuserbyprofilename ATTRIBUE AND CLICK NEXT
    InfoPathWebServices_12
    CLICK NEXT
    InfoPathWebServices_13
    CLICK NEXT
    InfoPathWebServices_14
    UNCHECK THE “Automatically retrieve data when form is open” CHECKBOX AND CLICK FINISH TO CREATE THE DATA CONNECTION
    InfoPathWebServices_15
  5. CREATE A NEW DATA COLLECTION LIBARY IN THE SHAREPOINT SITE WHERE YOUR INFOPATH FORM WILL LIVE
    InfoPathWebServices_16
  6. GO BACK TO INFOPATH AND EXPORT THE GetUserProfileByName DATA CONNECTION TO UDCX
    InfoPathWebServices_17
    BROWSE OR TYPE THE URL PATH OF THE DATA COLLECTION LIBRARY CREATED IN SHAREPOINT AND GIVE THE UDCX FILE A NAME OR KEEP DEFAULT FILE.UDCX AND CLICK “Ok”
    InfoPathWebServices_18
    GO BACK TO YOUR DATA COLLECTION LIBARARY IN SHAREPOINT AND THE UDCX FILE SHOULD NOW BE THERE
    InfoPathWebServices_19
    DOWNLOAD A LOCAL COPY OF THE UDCX FILE TO YOUR DESKTOP
    InfoPathWebServices_20
    OPEN UP THE LOCAL COPY OF THE FILE.UDCX FILE AND SEARCH FOR THE FOLLOWING LINE
    InfoPathWebServices_21
    UPDATE THE LINE AS FOLLOWS AND SAVE THE FILE.  REMEMBER TO DELETE THE LEADING “!–” AND TRIALING “
    InfoPathWebServices_22
    RE-UPLOAD THE FILE.UDCX FILE INTO THE DATA COLLECTION LIBRARY IN SHAREPOINT AND OVERWRITE THE EXISTING FILE
    InfoPathWebServices_23
  7. CREATE FORM LOAD RULES IN INFOPATH.
    GO BACK TO THE INFOPATH FORM AND CLICK ON THE “Data” TAB IN THE RIBBON AND SELECT “Form Load
    InfoPathWebServices_24
    THIS WILL LOAD THE FORM LOAD “RULES
    InfoPathWebServices_25
    CLICK “NEW” AND THEN “ACTION
    InfoPathWebServices_26
    GIVE THE RULE A NAME SUCH AS “Set User Profile” AND UNDER “Run these Actions:” CLICK “Add” AND SELECT “Set a field’s value
    InfoPathWebServices_27
    InfoPathWebServices_28
    CLICK THE TREE STRUCTURE BUTTON NEXT TO “Field“, CHANGE THE “Fields” DROP DOWN TO “GetUserProfileByName (Secondary)”.  EXPAND (myFields > queryFieldstns:GetUserProfileByName) AND SELECT “AccountName” AND CLICK “Ok
    InfoPathWebServices_29
    CLICK THE “Fx” BUTTON NEXT TO “Value”, AND ENTER IN THE FOLLOWING FORUMULA:  substring-after(username(), “i:0#.w|”) AND CLICK “Ok“, AND THEN “Ok” AGAIN.
    InfoPathWebServices_30
    BACK ON THE FORM LOAD RULES CLICK “Add” AND SELECT “Query for data
    InfoPathWebServices_31
    MAKE SURE “Action” IS SET TO “Query for data” and “Data Connection” IS SET TO “GetUserProfileByName“.  THIS SHOULD BE SET BY DEFAULT.  CLICK “Ok“.
    InfoPathWebServices_32
    BACK ON THE FORM LOAD RULES CLICK “Add” AND SELECT “Set a field’s value
    InfoPathWebServices_33
    CLICK THE TREE STRUCTURE BUTTON NEXT TO “Field“, KEEP THE “Fields” DROP DOWN TO “Main“.  EXPAND (myFields) AND SELECT “preferredName” AND CLICK “Ok
    InfoPathWebServices_35
    CLICK THE “Fx” BUTTON NEXT TO “Value“, AND CLICK THE “Insert Field or Group…” BUTTON.  CHANGE THE “Fields” DROPDOWN TO “GetUserProfileByName (Secondary)“.  EXPAND (dataFields>tns:GetUserProfileByNameResponse> GetUserProfileByNameResult> PropertyData>Values) AND SELECT “Value” AND CLICK THE “Filter Data…” BUTTON
    InfoPathWebServices_36
    NEXT CLICK THE “Add…” BUTTON AND CHANGE THE DROP DOWN FOR “Value” to “Select a field or group…
    InfoPathWebServices_37
    MAKE SURE THE DATA SOURCE IS STILL SET TO “GetUserProfileByName (Secondary)”.  SELECT “Name” FROM UNDER (dataFields> tns:GetUserProfileByNameResponse>GetUserProfileByNameResult > PropertyData) AND CLICK “Ok
    InfoPathWebServices_38
    IN THE SPECIFY FILTER CONDITION WINDOW, CHANGE THE BLANK DROP DOWN NEXT TO “Name is equal to” TO TYPE “Text
    InfoPathWebServices_39
    TYPE PreferredName IN THE BOX AND CLICK “OK” 4 TIMES
    InfoPathWebServices_40
    THE RULE DETAILS SHOULD NOW LOOK AS FOLLOWS.  IF SO, CLICK “OK
    InfoPathWebServices_42
    THE FORM LOAD RULES SHOULD NOW HAVE 3 ACTIONS.
    InfoPathWebServices_43
  8. PREVIEW YOUR INFOPATH FORM.  IF YOU FOLOWED THE STEPS ABOVE YOU SHOULD SEE YOUR ACCOUNT DISPLAYED IN THE FORM
    InfoPathWebServices_44
  9. IF THINGS WORKED AS EXPECTED.  TIME TO PUBLISH YOUR INFOPATH FORM TO SHAREPOINT.
    CLICK “File” SELECT “Publish” AND SELECT “SharePoint Server
    InfoPathWebServices_45
    TYPE IN THE URL OF THE SITE WHERE YOU WANT TO PUBLISH YOUR INFOPATH FORM.  THIS SHOULD BE HE SAME SITE WHERE YOU CREATED YOUR DATA COLLECTION LIBARARY.  CLICK “Next >”
    InfoPathWebServices_46
    STEP THROUGH THE WIZARD.  MAKE SURE THE “Enable this form to be filled out by using a browser” CHECK BOX IS CHECK, AND THE “Form Library” RADIO BUTTON SELECTED AND CLICK “Next >
    InfoPathWebServices_47
    STEP THROUGH THE WIZARD. ON THE NEXT SCREEN, IF YOU ALREADY HAVE A EXISTING FORM TEMPLATE LIBRARY SELECT THE “Update the form template in an existing form library” RADIO BUTTON AND SELECT YOUR LIBRARY.  FOR THIS CASE WE WILL KEEP THE “Create a new form library” RADIO BUTTON, AND CLICK “Next >“.
    InfoPathWebServices_48
    ON THE NEXT SCREEN, NAME YOUR FORM LIBRARY, AND GIVE A DESCRIPTION (OPTIONAL) AND CLICK “Next >“.
    InfoPathWebServices_49
    ON THE NEXT SCREEN, IF YOU WANT TO DISPLAY ANY FIELD COLUMNS IN YOUR SHAREPOINT FORM LIBRARY, CLICK “Add” AND ADD YOUR COLUMNS.  FOR THIS CASE WE WILL NOT ADD ANY COLUMNS, AND CLICK “Next >“.
    InfoPathWebServices_50
    VERIFY THE FORM INFORMATION AND CLICK “Publish
    InfoPathWebServices_52
    ONCE THE FORM IS PUBLISHED CLOSE OUT OF THE PUBLISHING WIZARD
    InfoPathWebServices_53
  10. TEST YOUR BROWSER ENABLED INFOPATH FORM IN SHAREPOINT

 

 

 

 

 

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: