Issue with "UserProfileService.asmx" in InfoPath with SharePoint 2016

Recently worked on an issue where the InfoPath form fails to load on browser on Sharepoint 2016.

Basically InfoPath form has data connection to call "UserProfileService.asmx" web service to retrieve the user profile data of a user on form load.

 

You would get following error:

An error occurred while trying to connect to a Web service.

An entry has been added to the Windows event log of the server.

Log ID:5566

 

You could find the below error from ULS logs:

w3wp.exe (OMTCP17117-F3:0x5284) 0x33D0 InfoPath Forms Services Runtime - Data Connections axf4d Exception System.Net.WebException: 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. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type Microsoft.SharePoint.SPTimeZone was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPropertyDataArray.Write2_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType)  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPropertyDataArray.Write3_ValueData(String n, String ns, ValueData o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPropertyDataArray.Write4_PropertyData(String n, String ns, PropertyData o, Boolean isNullable, Boolean needType)  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPropertyDataArray.Write5_ArrayOfPropertyData(Object o) --- End of inner exception stack trace ---  at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceRedirectionBase.SerializeData(Object data)  at Microsoft.Office.InfoPath.Server.SolutionLifetime.GetUserProfileByNameWebServiceRedirection.Execute() at Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.HandleInternalWebService(SPSite site, Uri destination, String name, XPathNavigator inputSubDOM) at 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 --- at 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=7edba41a-d847-44c0-b744-9800edc1e129|2|microsoft.office.server.native.pdb, offset=2864D) at Microsoft.Office.Server.Native.dll: (offset=2EABE) 7581099e-5ec9-d083-8310-f91d6d80507e

This can happen in following scenario:

  1. When we do not set default account while calling the UPA Service in InfoPath form.

2. When we have different time zone selected for a user at User Profile--> Language and Region-->"Always use my personal settings " And setting a different time zone .

 

 

Resolution:  There was  a defect raised for this behaviour and the same has been fixed in 16.0.4661.1000.

https://support.microsoft.com/en-us/help/4018293/description-of-the-security-update-for-sharepoint-enterprise-server-20

Published by: Neelesh Rai