SharePoint 2013 InfoPath GetUserProfileService.asmx Error 500 Internal Server Error – Unauthorized or User with the Account Name Could Not Be Found

Posted in: Blog, SharePoint 2007, SharePoint 2010, SharePoint 2013, SharePoint 2013 Errors |

No comments

INTRODUCTION

I’m in the process of migrating a SharePoint 2010 site to 2013. Within the site are several InfoPath forms that need to also be migrated to 2013. The migration was all easy except when I start filling the InfoPath form, I get an error querying the web service.

After some investigations I found out that the error was regarding a call to /_vti_bin/userprofileservice.asmx on GetUserProfileServiceByName method. The form uses this web service to retrieve current user information and also when retrieving manager’s information.

After fiddling around and looking at different articles online there are 2 steps in fixing this issue. Details are as follows.

NOTE: Article audience: medium to advanced users.

STEP 1. SECURE STORE SERVICE

First error I was getting was when I open the form, the web service kicks in to retrieve current user information. The error was 500 Internal Server Error Access Denied. To fix this follow these steps:

– Open InfoPath and modify your template and ensure that your Data Connection for the web service call is already converted to “relative to Site Collection”.

– Go to Central Admin -> General Application Settings -> Configure InfoPath Form Services. Then set the following:

– Then go to Central Admin -> General Application Settings -> Configure InfoPath Forms Services Web Service Proxy, then select the web application which you have your forms on and ENABLE BOTH tickboxes.
* Enable InfoPath Forms Services Web service proxy: YES
* Enable InfoPath Forms Services Web service proxy for user forms: YES

– Provision Secure Store Service, then create a new application.

– Set:
* Target Application ID: InfoPathForm
* Display Name: InfoPathForm
* Contact E-Mail: Your email eg. admin@admin.com
* Target Application Type: Group, then select None
* Click Next

– Leave everything as is on the next screen and click Next

– On the next screen set the following:
* Target Application Administrators: Farm account
* Members: This is basically the users who need to have access to the web service. In my case it’s NT AUTHORITY\Authenticated Users (ie. all domain users)

– Once you’ve done that a Secure Store Service application is created. Now, as you mouse over on it, a drop-down appears, select Set Credentials. Then set the account that has access to the web service. I just simply use Farm Account for simplicity. See below:

1

– Next step is to modify your UDCX file for the web service call located in the Data Connection Library. I named mine GetUserProfileService.udcx. As you open the file, the following line is commented out:

<udc:Authentication><udc:SSO AppId=”InfoPathForm” CredentialType=”NTLM” /></udc:Authentication>

Un-comment that line then in the AppId specify the ApplicationID you specified in Secure Store Service. In this example is InfoPathForm. Then set CredentialType to NTLM.

Then where it says UseFormsServiceProxy=”false” change it to UseFormsServiceProxy=”true”

– Upload the UDCX back to Data Connection Library.

– Go to IIS -> Your SharePoint web application -> Authentication. Make sure the following is disabled: Anonymous Authentication.

That’s it! You will not get any more authentication errors.

 

STEP 2. ACCESSING USER’S PROFILE DETAILS

Now, this step is optional. This is only relevant if you have a people picker control in the form, and as you select a user, you automatically access his/her profile such as email, work phone, etc.

I’m not going to detail on how to make it happen but assuming that you have already had a people picker control and a hidden textbox to parse the username, you need to do the following:

In SharePoint 2007 and 2010, you can simply pass in someone’s username without the domain to the GetUserProfileByName. For example, if I pass in “tommy” instead of “DOMAIN\tommy”, it will work. In 2013 this will NOT work. The error message was:

Message: The remote server returned an error: (500) Internal Server Error.  A user with the account name tommy could not be found.

2

In 2013 you HAVE TO pass in the domain. “tommy” will not work but “DOMAIN\tommy” will! Therefore, I have done the following:

3

See above I append my domain ie. “TFS\”. This is bad because it’s hardcoded. You can obviously do something fancy such as storing it in a SharePoint list then retrieve it in your form, etc.

I hope this helps everyone.

 

 

Happy InfoPathing,
Tommy

Written by

A web solution expert who has passion in website technologies. Tommy has been in the web industry for more than 10 years. He started his career as a PHP developer and has now specialized in ASP.NET, SharePoint and MS CRM. During his career he has also been in many roles: system tester, business analyst, deployment and QA manager, team and practice leader and IT manager.

No Comments Yet.

Leave a Reply

You must be logged in to post a comment.

Our Services

We provides you the best Services in our themes.

  • Click on the link below to see a full list of clients which we have developed solutions and provided consultancy for.

    READ MORE

  • We are solution-centered and not application-centered.

    READ MORE

  • Being creative and having fun and yet still delivering a fantastic service is the center of our values.

    READ MORE

  • TFS Consulting Services guarantees delivery that is within budget and deadline or you engage us for free.

    READ MORE

Implementing IT does not have to be difficult.

As long as you have the right methodologies

We have heard a lot of complaints from our clients that IT a lot of the times give them headache. The issues range from over-budget implementation, server is too hard to maintain, application is not user friendly, features not complete and many others. If you have ever experienced similar situations, don’t worry. This is why TFS Consulting Services is here. We exist to help clients implementing a successful IT solution. We have various methodologies which we have proven working in delivering a successful IT implementation. Below is the list of some of our key service offerings:
  • Planning and Methodologies

    Implementing IT solution does not have to be difficult. TFS Consulting Services has a lot of resources on planning and methodologies that will ensure successful delivery of your IT solution. TFS Consulting Services has been around in the web industry for more than 10 years and has experienced all the successes and failures of various type of IT deployment.

    read more

  • Technical Resource

    Do you need a technical resource? TFS Consulting Services can also provide you with technical resource for developing ASP.NET (C# and VB.NET), SharePoint (2003, 2007, 2010, 2013) and MS CRM applications. Our resource is an Microsoft Certified Personnel (MVP) and Microsoft Certified Technology Specialist (MCTS) in all ASP.NET, SharePoint and CRM.

    read more

  • IT Consulting & Advice

    Make sure your IT implementation is robust and scalable. TFS Consulting Services can provide consulting and advice on industry’s best practice on various web-related areas such as website security, design and usability, application-specific (such as SharePoint)’s best practice, Search Engine Optimisation (SEO), coding standards and many others.

    read more

  • Solution Development

    Finally TFS Consulting Services provides you with solution development service. We mainly work with Microsoft technologies (ie. .NET and SQL Server), however we are also capable of developing with PHP and MySQL. If you ever need any business process automation, integration and solution development work,  we are the trusted expert you should go to.

    read more

For more detailed service offerings please visit our Solutions page.

Testimonials

  • I’m happy to recommend Tommy as a knowledgeable and diligent developer.

    Mike Stringfellow, Vivid Group
  • Tommy has a lot of great ideas that can be delivered into great products. It’s a pleasure working with him because he has a broad knowledge about available technologies out there and he knows what’s best for the client’s needs. He just knows how to work effectively and efficiently.

    Teddy Segoro, Student Edge
  • I’ve worked with Tommy over the past 6 months and have found his approach to development (especially SharePoint) absolutely outstanding. Tommy goes beyond the boundries of typical software development with his ability understand what a client requires and then build it into fully fledged software solution. Coupled with his professional “Best Practice” approach, you get Continue Reading

    Michael Bonham, DSC-IT

Contact us

Tommy Segoro
tommy@tfsconsulting.com.au
+61 404 457 754

   

© TFS Consulting Services 2024. All rights reserved.

www.incorporator.com.au