戰地連結︰ Home My Flickr NBA.com About

2008年6月26日星期四

My struggle with Browser enabled InfoPath Form connection to 'UserProfileService' Web Service

Overview

I faced a silly error when trying to use data connection in a Browser-enabled InfoPath Form to connect to MOSS built-in 'UserProfileService' web service in order to retrieve the display name (Preferred Name) of the logged in user. It works great without any error when I preview the form in InfoPath. However, I keep seeing the "ID 5566" error after I published the form to a document library and open it in browser. On the other hand, the published form works to show the current logged in user of the computer (not the MOSS portal) when opened in a client application (i.e. InfoPath).

Symptom

  1. Fail with "ID 5566" error when the form is opened in web browser.
  2. Work without error when opened in preview mode or in client application, shows the logged in user of the computer.
  3. Fail to work with all methods in 'UserProfileService' web service.

Cause

After many googling and trial & error, I still can't find the cause. Or I actually overlooked one suggestion in a post. That is the "Allow Anonymous login" option. I thought that this is the option in "Central Administration" -> "Application Management" -> "Authentication Providers" -> "Edit Authentication". But actually the main problem is at IIS settings of the web applications' authentication.

Reference

InfoPath - Get the current user without writing code

Steps to disable "anonymous login" in "IIS Manager"

  1. In Windows Server 2003 R2, click "Start" -> "Administrative Tools" -> "Internet Information Services (IIS) Manger"
  2. In "IIS Manager", expand the name of your computer on the left pane, expand "Web Sites"
  3. Right click on the web application you want to edit (e.g. mine is "SharePoint - 80", select "Properties"
  4. In "Properties", select "Directory Security" tab. Press "Edit" in the "Authentication and access control" category
  5. Uncheck "Enable anonymous access" in "Authentication Methods", click "OK" to go back to IIS Manager

沒有留言: