none
infopath by sharepoint 2016 SOAP Web Query GetUserProfileByName, error 5566, but no environmental problem sharepoint2013 RRS feed

  • Question

  • HELLO:

             

    I set up a new sharepoint 2016 environment. But also a new production of infopat form. I also facing the same problem of 5566. sharepoint 2013 does not have this problem. I hope someone can help solve. thank you very much., we are currently using a InfoPath form that query UserProfil Webservice in order to get GetUserProfileByName, 

    In order to make the data connection work I followed this tuto (http://www.cdhtalkstech.com/2013/05/31/using-infopath-2013-to-query-data-from-the-user-profile-service-in-sharepoint-2013/) but I'm still getting error and more particularly : "The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator" 

    Did one of you faced the same problem ? See complete log below:


    InfoPath Forms Services       Runtime - Data Connections    
    m1v0 Warning 
    The following query failed: GetUserProfileByName (User: 0#.w|ph\sce_sharepoint2016, Form Name: Template_JobRequestv2, IP: , Connection Target: http://phind-app38:200/collaborative/job-request/ConnectionLibrary/Permanent_GetUserProfileByName.udcx, Request: http://phind-app38:200/collaborative/job-request/Lists/Temp%2520Job%2520Request/In%2520progress.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:Template-JobRequestv2:-dataFormSolution Type: DataAdapterException, Exception Message: The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator. The custom code in the form cannot be run. This functionality may be deactivated on the server. For more
    Sunday, June 12, 2016 5:58 AM

Answers

  • Hi 

    Step1

    Try  Hardcoding the active directory User in your GetUserProfileByName data source, to see if the problem remains.

    - When you create the GetUserProfileByName data source you get to a Parameter Screen where you can set Value, add there one active directory user DOMAIN\USER

    Check first if it works in preview then Publish and test

    If this work then you don't really have a problem.

    SOLUTION:

    1-      GetUserProfileByName  has to be filtered for a specific user (logged in user for example) before it is queried else you get the error. (this was not the case in SP2013)

    2-      Get rid of: “0#.w| (The characters before the AD account)  when filteringGetUserProfileByName  (else you will get same error) (see step below)

    3-      More importantly and very surprisinglySharePoint 2016 you does not Need to use The secure Store anymore nor to convert the data connection to udcx nor to edit it etc … I will appreciate if one of you confirm this!

    SOLUTION STEPS:

    1-      When you create the GetUserProfileByName connection untick: Automatically retrieve Data when form is opened (instead we will run a rule on Form Load)

    2-      Create a txt Field to hold the AD user credentials: MyUserName (or call it anything you like)

    3-      Add the following rules on FORM LOAD

    1.        Set Field’s Value MyUserName = substring-after(userName(), "|") (this will get rid of the awful characters and store the AD account that we will use to filter GetUserProfileByName  )
    2.       Set Field’s Value AccountName = MyUsername (AccountName is the field you get by selecting GetUserProfileByName  / myFields/queryFields/tns:getUserProfileByName/AccountName
    3.        Query using a data connection GetUserProfileByName 

    The order of these rules is important!!!

    More detailed steps here.

    • Proposed as answer by XXAE1 Monday, June 20, 2016 10:03 AM
    • Edited by XXAE1 Monday, June 20, 2016 10:46 AM
    • Marked as answer by Victoria XiaModerator Monday, July 11, 2016 2:49 AM
    Monday, June 20, 2016 10:02 AM
  • Hi tom.chen.cn,

    You could add trust location in InfoPath. Open the InfoPath->click file tab->click options->click Trust Center->Trust center settings->trusted locations->add new location.

    You could run the SharePoint 2016 products configuration wizard to check if it can work. It will repair the SharePoint 2016.

    And you also could restart the SecurityTokenServiceApplicationPool in the application pool in IIS.

    And you could do IIS reset to check if it can work.

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, June 17, 2016 2:05 AM
    Moderator

All replies

  • Was the form published via Central Admin? Was it activated?

    Trevor Seward

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.


    Sunday, June 12, 2016 7:56 PM
    Moderator
  • Hi tom.chen.cn,

    From the error message "The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator", it indicates that the code you add in the form cannot work. You may add the custom code in the form according to the article you refer to.

    So firstly I suggest that you could remove the custom code you have added in the form.

    For troubleshooting the event 5566 issue, you could check things below:

    1. The event 5566 issue usually is an authentication issue. You could disable the ‘Authentication Loopback’ check.

    2. You could check if the InfoPath form configuration is right in central administration. Go to central administration->General application settings-> Configure InfoPath Forms Services.

    3. Enable the Web Service Proxy for InfoPath Service and Enable InfoPath Forms Services Web service proxy for user forms in Central Administration. Go to central administration->General application settings-> Configure InfoPath Forms Services Web Service Proxy.

    4. Check if the Proxy Setting is right in web.config. Find the “<defaultProxy>” in the web.config to check the Proxy Settings under the “<defaultProxy>”  tag.

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, June 13, 2016 3:22 AM
    Moderator
  • InfoPath Forms Services Runtime - Data Connections axf31 Medium Using redirection for GetUserProfileByName 589f869d-543b-e04f-898f-278c06e9a95c.
    06/16/2016 13: 56:.. 56.94 w3wp.exe (0x39C4) 0x266C InfoPath Forms Services Runtime - Data Connections axf4b Medium Redirection for web service call to GetUserProfileByName found Executing 589f869d-543b-e04f-898f-278c06e9a95c
    06/16/2016 13: 56: 56.96 w3wp.exe (0x39C4) 0x266C InfoPath Forms Services Runtime - Data Connections axf4d Exception System.Net.WebException: a form of custom code can not run. This feature may be disabled on the server. For more information, please contact the farm administrator. ---> System.NullReferenceException: Object reference not set to an instance of an object. In Microsoft.Office.InfoPath.Server.SolutionLifetime.UserProfileWebServiceRedirectionBase.LoadProfileData (UserProfile userProfile) in Microsoft.Office.InfoPath.Server.SolutionLifetime.UserProfileWebServiceRedirectionBase.GetUserProfileByNameInternal (String userName) at Microsoft.Office.InfoPath.Server.SolutionLifetime.GetUserProfileByNameWebServiceRedirection.Execute () in Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.HandleInternalWebService (SPSite site, Uri destination, String name, XPathNavigator inputSubDOM) in Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.ExecWebRequestSync (XPathNavigator inputSubDOM, Boolean [] inputUseDataset, XPathNavigator resultsSubDOM, Boolean resultUseDataset, XPathNavigator errorsSubDOM, Uri serviceUrl, Uri soapAction, Int64 timeOutMillisec, DataAdapter adapter, Document document, DataAdapterCredentials credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf) --- end of inner exception stack trace --- in Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.ExecWebRequestSync (XPathNavigator inputSubDOM, Boolean [] inputUseDataset, XPathNavigator resultsSubDOM, Boolean resultUseDataset, XPathNavigator errorsSubDOM, Uri serviceUrl, Uri soapAction, Int64 timeOutMillisec, DataAdapter adapter, Document document, DataAdapterCredentials credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf) StackTrace: at Microsoft.Office.Server.Native.dll: (sig = 44e0fda3-6960-4843-8128-8afc65c1a23a | 2 | microsoft.office.server.native.pdb, offset = 28145 ) at Microsoft.Office.Server.Native.dll: (offset = 2E522) 589f869d-543b-e04f-898f-278c06e9a95c
    06/16/2016 13: 56: 56.96 w3wp.exe (0x39C4) 0x266C SharePoint Server Unified Logging Service c91s Monitorable Watson bucket parameters: SharePoint Server 2016, ULSException14, 41b7c39f "infopath forms services", 100010ff "16.0.4351.0", fd34ba92 " microsoft.office.infopath.server ", 100010de" 16.0.4318.0 ", 5654382d" tue nov 24 18:13:01 2015 ", 000028b8" 000028b8 ", 00000100" 00000100 ", 4380fbf4" webexception ", 005c5783" axf4d "589f869d- 543b-e04f-898f-278c06e9a95c
    06/16/2016 13: 56: 56.96 w3wp.exe (0x39C4) 0x266C InfoPath Forms Services Runtime - Data Connections m1bf Medium Web Request: WebException Caught 589f869d-543b-e04f-898f-278c06e9a95c
    06/16/2016 13: 56: 56.96 w3wp.exe (0x39C4) 0x266C InfoPath Forms Services Runtime - Data Connections m1bc Medium Web Request: Copying response to DOMs 589f869d-543b-e04f-898f-278c06e9a95c
    06/16/2016 13: 56: 56.96 w3wp.exe (0x39C4) 0x266C InfoPath Forms Services Runtime amzyn Medium Outer Exception: in the form of custom code can not run. This feature may be disabled on the server. For more information, please contact the farm administrator. . Stack trace: at Microsoft.Office.InfoPath.Server.Util.InfoPathException.LogException (Exception e) at Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.HandleExecWebRequestException (Document document, Exception exception, ExecWebRequestExceptionState state, Byte [] exceptionResponse , Ids errorId) in Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.ExecWebRequestSync (XPathNavigator inputSubDOM, Boolean [] inputUseDataset, XPathNavigator resultsSubDOM, Boolean resultUseDataset, XPathNavigator errorsSubDOM, Uri serviceUrl, Uri soapAction, Int64 timeOutMillisec, DataAdapter adapter, Document document , DataAdapterCredentials credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf) in Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterWebServiceQuery.Execute (Uri soapAction, Uri serviceUrl, XPathNavigator queryParamSubDOM, XPathNavigator resultsSubDOM, XPathNavigator errorsSubDOM, Int64 timeout, Document document, DataAdapterCredentials credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf) in Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterWebServiceQuery.ExecuteInternal (XPathNavigator queryFields, XPathNavigator resultFields, XPathNavigator errors) in Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.QueryDataOnLoad ( DataAdapter documentDataAdapter, DataObject documentDataObject) in Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteInitOnLoadForDataObjects () in Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.LoadSolutionAndDocument (HttpContext context, Solution solution, documentMetaInformation documentMetaInformation, OnInitializeCallback onInitializeCallback, OpenParameters openParameters) in Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.OpenDocumentWithSolution (HttpContext context, SPSite contextSite, Solution solution, DocumentMetaInformation documentMetaInformation, onInitializeCallback onInitializeCallback, openParameters openParameters) in Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.NewFromSolution ( HttpContext context, SPSite contextSite, Solution solution, DocumentMetaInformation documentMetaInformation, Boolean disableFirstRequestOptization, onInitializeCallback onInitializeCallback, openParameters openParameters) in Microsoft.Office.InfoPath.Server.Controls.XmlFormView.DataBindInternal (solutionMetaInformation solutionMetaInformation, DocumentMetaInformation documentMetaInformation, String absoluteSolutionLocation, Boolean hasCloseHandler, Document & document ) in Microsoft.Office.InfoPath.Server.Controls.FormServerPage.InitializeRenderInLine (SolutionMetaInformation solutionMetaInformation, documentMetaInformation documentMetaInformation, String absoluteSolutionLocation) in Microsoft.Office.InfoPath.Server.Controls.FormServerPage.NewEditingSession (SPSite contextSite, FormServerPageQueryParameters queryParameters, Boolean isFormServerProperlyConfigured, Boolean & renderSessionsStateError) in Microsoft.Office.InfoPath.Server.Controls.XmlFormView.StartNewEditingSession () in Microsoft.Office.InfoPath.Server.Controls.XmlFormView.EnsureDocument (eventLogStart eventLogStart) in Microsoft.Office.InfoPath.Server.Controls.XmlFormView. < > c__DisplayClassb. <LoadDocumentAndPlayEventLog> b__5 () in Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter (Boolean fRethrowException, tryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, finallyBlock finallyBlock) in Microsoft.Office.InfoPath.Server.DocumentLifetime.ErrorPageRenderer. RunAndGetErrorRendererOnException (HttpContext context, eventLogStart eventLogStart, tryBlock tryblock, CatchBlock catchblock) in Microsoft.Office.InfoPath.Server.Controls.XmlFormView.LoadDocumentAndPlayEventLog () in Microsoft.Office.InfoPath.Server.Controls.XmlFormView.OnDataBindHelper () in Microsoft.Office .InfoPath.Server.Controls.XmlFormView.OnDataBinding (EventArgs e) at System.Web.UI.WebControls.WebParts.Part.DataBind () in Microsoft.Office.InfoPath.Server.Controls.FormServerPage.Initialize () in Microsoft.Office .InfoPath.Server.Controls.FormServerPage.OnInit (EventArgs e) at System.Web.UI.Control.InitRecursive (Control namingContainer) in System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) in System.Web. UI.Page.ProcessRequest (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) in System.Web.UI.Page.ProcessRequest () in System.Web.UI.Page.ProcessRequest (HttpContext context) at Microsoft.Office.InfoPath.Server.Controls.FormServerPage .ProcessRequest (HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute () in System.Web.HttpApplication.ExecuteStep (IExecutionStep step, Boolean & completedSynchronously) in System.Web.HttpApplication.PipelineStepManager. ResumeSteps (Exception error) in System.Web.HttpApplication.BeginProcessRequestNotification (HttpContext context, AsyncCallback cb) in System.Web.HttpRuntime.ProcessRequestNotificationPrivate (IIS7WorkerRequest wr, HttpContext context) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper (IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) in System.Web.Hosting.PipelineRuntime.ProcessRequestNotification (IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) in System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion (IntPtr pHandler, RequestNotificationStatus & notificationStatus) in the System .Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion (IntPtr pHandler, RequestNotificationStatus & notificationStatus) in System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper (IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) in System.Web.Hosting.PipelineRuntime.ProcessRequestNotification (IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags). 589f869d-543b-e04f-898f-278c06e9a95c
    06/16/2016 13: 56: 56.96 w3wp.exe (0x39C4) 0x266C InfoPath Forms Services Runtime amzyo Medium Inner Exception form of custom code can not run. This feature may be disabled on the server. For more information, please contact the farm administrator. .
    Thursday, June 16, 2016 10:51 AM
  • Hello:
              The above is an error log, you say four cases in front of three cases can be excluded. Because in sharepoint 2013, we installed our test setup is no problem. Then sharepoint 2016 environment will be given. Then we use the file does not remain local or centralized management UDCX file. 5566. But also being given a form to get the information to the user. Although there are errors. But it can be read to the user parameters. I really do not understand. I do not think my infopath problem. Nor is it set up inside the center management issues. Because the normal work in sharepoint 2013 inside. Hope can help me. thank you very much
    Thursday, June 16, 2016 10:58 AM
  • Hi tom.chen.cn,

    You could add trust location in InfoPath. Open the InfoPath->click file tab->click options->click Trust Center->Trust center settings->trusted locations->add new location.

    You could run the SharePoint 2016 products configuration wizard to check if it can work. It will repair the SharePoint 2016.

    And you also could restart the SecurityTokenServiceApplicationPool in the application pool in IIS.

    And you could do IIS reset to check if it can work.

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, June 17, 2016 2:05 AM
    Moderator
  • Hi 

    Step1

    Try  Hardcoding the active directory User in your GetUserProfileByName data source, to see if the problem remains.

    - When you create the GetUserProfileByName data source you get to a Parameter Screen where you can set Value, add there one active directory user DOMAIN\USER

    Check first if it works in preview then Publish and test

    If this work then you don't really have a problem.

    SOLUTION:

    1-      GetUserProfileByName  has to be filtered for a specific user (logged in user for example) before it is queried else you get the error. (this was not the case in SP2013)

    2-      Get rid of: “0#.w| (The characters before the AD account)  when filteringGetUserProfileByName  (else you will get same error) (see step below)

    3-      More importantly and very surprisinglySharePoint 2016 you does not Need to use The secure Store anymore nor to convert the data connection to udcx nor to edit it etc … I will appreciate if one of you confirm this!

    SOLUTION STEPS:

    1-      When you create the GetUserProfileByName connection untick: Automatically retrieve Data when form is opened (instead we will run a rule on Form Load)

    2-      Create a txt Field to hold the AD user credentials: MyUserName (or call it anything you like)

    3-      Add the following rules on FORM LOAD

    1.        Set Field’s Value MyUserName = substring-after(userName(), "|") (this will get rid of the awful characters and store the AD account that we will use to filter GetUserProfileByName  )
    2.       Set Field’s Value AccountName = MyUsername (AccountName is the field you get by selecting GetUserProfileByName  / myFields/queryFields/tns:getUserProfileByName/AccountName
    3.        Query using a data connection GetUserProfileByName 

    The order of these rules is important!!!

    More detailed steps here.

    • Proposed as answer by XXAE1 Monday, June 20, 2016 10:03 AM
    • Edited by XXAE1 Monday, June 20, 2016 10:46 AM
    • Marked as answer by Victoria XiaModerator Monday, July 11, 2016 2:49 AM
    Monday, June 20, 2016 10:02 AM