locked
Webservice call Fails from Infopath Webbased form RRS feed

  • Question

  • Hi all,

    have a problem with a custom for that is calling out to the Usergroup.asmx webservice  

    the Error i get when the form is opened is

    "An error occurred accessing a data source.

    An entry has been added to the Windows event log of the server.
    Log ID:5566"


    the errors in the IIS log point to 401.1 which is an unauthorizes access. the form works fine in a preview through VS 2008 but one the form is uploaded to MOSS 2007 it begins to fail. 

    2008-08-25 18:34:49 <siteID> <serverName> <IP> POST /_vti_bin/UserGroup.asmx - 80 - <UserIP> HTTP/1.1 InfoPathDA - -<site>401 5 0 340 954 343
    2008-08-25 18:34:49 <SIteID> <ServerName> <IP> POST /_vti_bin/UserGroup.asmx - 80 - <UserIP> HTTP/1.1 InfoPathDA - - <Site> 401 1 0 2209 477 0
    2008-08-25 18:34:49 <SiteID> <ServerName> <IP> POST /_vti_bin/UserGroup.asmx - 80 - <UserIP> HTTP/1.1 InfoPathDA - - <Site> 401 1 2148074252 1801 1248 15




    Error logs from MOSS SUpports this

    "08/25/2008 13:34:49.49  w3wp.exe (0x019C)                        0x0850 Forms Server                   Forms Services Data Objects    13zh Exception  System.Net.WebException: The remote server returned an error: (401) Unauthorized.     at System.Net.HttpWebRequest.GetResponse()     at Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.GetResponseHelper(WebRequest request, DataAdapterTimer dataAdapterTimer, DataAdapterCredentials credentials, Stopwatch timer, ExecWebRequestExceptionState state, String adapterName, Boolean isQuery)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.WebServiceHelper.ExecWebRequestSync(XPathNavigator inputSubDOM, Boolean[] inputUseDataset, XPathNavigator resultsSubDOM, Boolean resultUseDataset, XPathNavigator errorsSubDOM, Uri serviceUrl, Uri soapAction, Int64 timeOutMillisec, Solution solution, Document document, String name, Boolean isQuery, DataAdapterTimer dataAdapterTimer, DataAd... f862bcea-4a98-43f9-8c68-ed684d967222
    08/25/2008 13:34:49.49* w3wp.exe (0x019C)                        0x0850 Forms Server                   Forms Services Data Objects    13zh Exception ...apterCredentials credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf) f862bcea-4a98-43f9-8c68-ed684d967222
    08/25/2008 13:34:49.49  w3wp.exe (0x019C)                        0x0850 Forms Server                   Forms Services Data Objects    7tfk Medium   Data adapter failed during OnLoad: The remote server returned an error: (401) Unauthorized. f862bcea-4a98-43f9-8c68-ed684d967222
    08/25/2008 13:34:49.49  w3wp.exe (0x019C)                        0x0850 Forms Server                   Forms Services Runtime - Data C 82fy Warning  The following query failed: GetServerEngineersFromGroup (User: <UserNAME>, Form Name: TestTemplate, IP: , Request: http://<site>/_layouts/FormServer.aspx?XsnLocation=http://<site>/FormServerTemplates/TestTemplate.xsn&SaveLocation=http://<site>/SiteDirectory/serverbuild/Server+Build+Forms&Source=http://<site>/SiteDirectory/serverbuild/Server%2520Build%2520Forms/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:TestTemplate:-myXSD-2008-08-25T17-47-23, Type: DataAdapterException, Exception Message: The remote server returned an error: (401) Unauthorized. The remote server returned an error: (401) Unauthorized.) f862bcea-4a98-43f9-8c68-ed684d967222
    08/25/2008 13:34:49.49  w3wp.exe (0x019C)                        0x0850 Forms Server                   Forms Services Runtime - Busine 82g6 Warning  Business logic failed due to an exception. (User:DOMAIN\UserName, Form Name: TestTemplate, IP: , Request: http://<site>/_layouts/FormServer.aspx?XsnLocation=http://<site>/FormServerTemplates/TestTemplate.xsn&SaveLocation=http://<site>/SiteDirectory/serverbuild/Server+Build+Forms&Source=http://<site>/SiteDirectory/serverbuild/Server%2520Build%2520Forms/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:TestTemplate:-myXSD-2008-08-25T17-47-23, Type: ArgumentNullException, Exception Message: Value cannot be null.  Parameter name: newNode) f862bcea-4a98-43f9-8c68-ed684d967222
    08/25/2008 13:34:49.49  w3wp.exe (0x019C)                        0x0850 Forms Server                   Forms Services Object Model    7tge Assert   Exception thrown from business logic event listener StackTrace:   at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages userMessages, OMCall d)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.FireLoadingEvent(Document document, Dictionary`2 inputParameters)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.PerformOnLoadEvent(Dictionary`2 intputParameters)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.LoadSolutionAndDocument(HttpContext context, Solution solution, DocumentMetaInformation documentMetaInformation, OnInitializeCallback onInitializeCallback, OpenParameters openParameters)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.OpenDocumentWithSo... f862bcea-4a98-43f9-8c68-ed684d967222
    08/25/2008 13:34:49.49* w3wp.exe (0x019C)                        0x0850 Forms Server                   Forms Services Object Model    7tge Assert   ...lution(HttpContext context, SPSite contextSite, Solution solution, DocumentMetaInformation documentMetaInformation, OnInitializeCallback onInitializeCallback, OpenParameters openParameters)     at Microsoft.Office.InfoPath. f862bcea-4a98-43f9-8c68-ed684d967222


    I think pretty sure the issue lies with authentican using NTLM Vs Kerberos (App Pool is using a Unique account) does anyone have any insight or had any problems like this?



    Thanks in Advance!
    Monday, August 25, 2008 6:44 PM

Answers

  • Use fiddlertool or any other http analyzer and check if you see   UserGroup.asmx made from the client
    If you dont see UserGroup.asmx request on the client Follow this KB http://support.microsoft.com/kb/926642

    Method 1: Disable the authentication loopback check

    Re-enable the behavior that exists in Windows Server 2003 by setting the DisableLoopbackCheck registry entry in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa registry subkey to 1. To set the DisableLoopbackCheck registry entry to 1, follow these steps on the client computer:

    1. Click Start, click Run, type regedit, and then click OK.
    2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
    3. Right-click Lsa, point to New, and then click DWORD Value.
    4. Type DisableLoopbackCheck, and then press ENTER.
    5. Right-click DisableLoopbackCheck, and then click Modify.
    6. In the Value data box, type 1, and then click OK.
    7. Exit Registry Editor.
    8. Restart the computer.
    • Proposed as answer by Aniket SPoint Friday, May 1, 2009 7:11 PM
    • Marked as answer by Kevin Oliver Friday, May 1, 2009 10:22 PM
    Friday, December 5, 2008 1:01 AM

All replies

  • can you show some code? I've done this and got similar issues, you have to specify the credentials the web service is going to use.

    websrv.Credentials = System.Net.CredentialCache.DefaultCredentials


    David Lozzi
    Wednesday, August 27, 2008 4:56 PM
  • Dave,

    Thanks for the reply, I have specified what credentials:
    ProfileService.UserProfileService profileService = new ProfileService.UserProfileService();  
    //profileService.Credentials = new System.Net.NetworkCredential "<userName", ,"<Password>", "<domain>");  
                profileService.UseDefaultCredentials = true;  
                ProfileService.PropertyData[] userProps = null;  
     
     
                try 
                {  
                    // Passing null to this method causes the profile of the current user to be returned.  
                    // We are passing the value of the dropdown to this to return the users email address  
     
     
                    userProps = profileService.GetUserProfileByName(field1.Value.ToString());  
     
     
                }  
                catch (Exception) 

    This was the code i thought was causing me the issue but it looks like startup code it causing the problems and it is definitely a permissions based issue.


    //create the XmlNamespaceManager that will allow us to navigate the xml  
                    XmlNamespaceManager ddBmanager = new XmlNamespaceManager(DropDownBManager.NameTable);  
     
                    ddBmanager.AddNamespace("dfs""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution");  
     
                    ddBmanager.AddNamespace("tns""http://schemas.microsoft.com/sharepoint/soap/directory/");  
     
                    //get the node that contains all the users from the call to the web service  
                    XPathNavigator dBusers = DropDownBManager.SelectSingleNode("/dfs:myFields/dfs:dataFields/tns:GetUserCollectionFromGroupResponse/tns:GetUserCollectionFromGroupResult/tns:GetUserCollectionFromGroup/tns:Users", uBmanager); 

    Basically the above code is connected to a drop down on the infopath form, loads a dummy XML file to pre-populate it then calls out to the usergroup.asmx through a secondary connection to get the users of a specific sharepoint group. the results work fine when i preview the form on my machine through VS 2008, it will also work fine for me in out prod environment. Other users can see the from. But they get errors trying stating that they cannot connect to the webservice on that machine (i have navigated out to that site from those user accounts and they do have access to get to the site). I have tested this form in another Dev sharepoint environment and it worked fine for multiple users. 

    the errors that it give are this

    "An error occurred accessing a data source.

    An entry has been added to the Windows event log of the server.
    Log ID:5566

    An error occurred accessing a data source.

    An entry has been added to the Windows event log of the server.
    Log ID:5566

    An error occurred accessing a data source.

    An entry has been added to the Windows event log of the server.
    Log ID:5566

    An entry has been added to the Windows event log of the server.
    Log ID:5337
    "

    checking for these errors on the serve reveals nothing (no errors are logged in the event viewer) 

    i have successfully run the code snippet above (#2) on the prod box without issue for the same users. I am worried that the server has had to many hands touching it during setup and config and now is no longer dependable. That is another worry though till i can get this form working :)  

    Any input would be amazing (possibly were i can get the errors for these supposed events that are written to the eventlog!) 

      
    Thursday, August 28, 2008 12:45 PM
  • I have the same problem. One InfoPath Form web-based that access a HelloWorld WebServices. In preview mode it works fine, but when i publish in Forms Services it doesn't work.

    I identify that this error occurs after .NET Framework 3.5 SP1 installation, but I don't find a solution for this problem....

    Thursday, October 30, 2008 12:28 PM
  • You can try the following to pinpoint the issue. Definitely its a permissions issue.  First thing, the user who is using the web service, or in other words, who is running the form should have permissions in the site from the web service is being called. You can call the service from different paths, like from the root path (http://server), from the subsite (http://server/Sites/site1/_layouts/UserGroups.asmx), etc. So if you are accessing it, lets say, from a subsite like http://server/sites/site1 then make suire the person running the form has permissions on this site. Second thing is, pass the credentials explicitly. I know this is a known problem. The default credentials work during the development or testing on the local machine but over the net, the credentials fail. You will have to provide credentials explicitly like this:

    ProfileService.UserProfileService profileService = new ProfileService.UserProfileService();

                    profileService.PreAuthenticate = true;
                    CredentialCache credentials = new CredentialCache();
                    NetworkCredential netCredentials = new NetworkCredential("username", "password", "domainname");
                    credentials.Add(new Uri(profileService.Url), "Basic", netCredentials);
                    profileService.Credentials = credentials;

    If you are using proxy, and the above still does not work, then use the proxy like this:

                    profileService.Proxy = new WebProxy("http://proxyserver:2020", true);
                    profileService.Proxy.Credentials = credentials;


    The biggest problem is that this method sends the credentials in plain text to the server and the workaround is to use a specific web account to use for this service. Instead of using your username, create a user account just to handle this service, add that to web.config and retrieve the username and password from the web.config when running the web service. You can save the userid and password in encrypted form for extra security.

    Try this and I am sure it will work over the net.

    Happy programming!

    http://sharepointblogs.com/ssa


    SSA
    • Marked as answer by Kevin Oliver Friday, May 1, 2009 10:21 PM
    • Unmarked as answer by Kevin Oliver Friday, May 1, 2009 10:22 PM
    Thursday, October 30, 2008 4:00 PM
  • Use fiddlertool or any other http analyzer and check if you see   UserGroup.asmx made from the client
    If you dont see UserGroup.asmx request on the client Follow this KB http://support.microsoft.com/kb/926642

    Method 1: Disable the authentication loopback check

    Re-enable the behavior that exists in Windows Server 2003 by setting the DisableLoopbackCheck registry entry in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa registry subkey to 1. To set the DisableLoopbackCheck registry entry to 1, follow these steps on the client computer:

    1. Click Start, click Run, type regedit, and then click OK.
    2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
    3. Right-click Lsa, point to New, and then click DWORD Value.
    4. Type DisableLoopbackCheck, and then press ENTER.
    5. Right-click DisableLoopbackCheck, and then click Modify.
    6. In the Value data box, type 1, and then click OK.
    7. Exit Registry Editor.
    8. Restart the computer.
    • Proposed as answer by Aniket SPoint Friday, May 1, 2009 7:11 PM
    • Marked as answer by Kevin Oliver Friday, May 1, 2009 10:22 PM
    Friday, December 5, 2008 1:01 AM
  • I'm getting similar problems with an admin published form using managed code. The preview in InfoPath works fine but the published form fails when opening with event ID 5337. The server application log has the following entry:

    Event Type: Warning
    Event Source: Office SharePoint Server
    Event Category: Forms Services Runtime - Business Logic
    Event ID: 5337
    Date:  2009-07-09
    Time:  14:37:09
    User:  N/A
    Computer: SERVERNAME
    Description:Business logic failed due to an exception.User:    DOMAIN\username,
    Form Name:   FormName,
    IP: ,
    Request:   
    http://address.domain.com/_layouts/FormServer.aspx?XsnLocation=http://address.domain.com/FormServerTemplates/FormName.xsn&SaveLocation=http://address.domain.com/FormLibrary&Source=http://address.domain.com/FormLibrary/Forms/AllItems.aspx&DefaultItemOpen=1,
    Form ID:   urn:schemas-microsoft-com:office:infopath:FormName:-myXSD-2009-05-13T13-53-20,
    Type:    WebException,
    Exception Message:  Security Restrictions on the server are preventing the data connection being used.   (translated from Swedish so this might not be 100% accurate to the standard MS error)

    --

    Continuing to open the form shows the form as expected but the lookup fields are not populated from the secondary data source.
    There are two data sources accessed via webservices:
    1st. SharePoint UserProfileService.asmx
    2nd. the clients own custom webservice to a data source retaining orginisation data similar to Active Directory

    I can access the webservices directly (from the server) without problems, using the same logged in user ID.
    The webservices have not been changed.

    The form is published to MOSS with Domain trust.

    The previous version of the form worked as expected.
    The latest version of the form has had the code updated to better present the returned data from the 2nd data source and throws the error above.

    I've read other forums suggesting the win2k3 server loopback check is blocking this but I don't want to go messing with the registry until I've exhausted other avenues.

    Any ideas would be greatly appreciated!

    Monday, July 13, 2009 12:23 PM
  • its possible a Kerberos Delegation issue.

    Configurar MOSS 2007 para invocar un Web Service desde un Formulario InfoPath en NLB

    Regards,

    GuilleSQL
    http://www.guillesql.es

    This posting is provided AS IS with no warranties, and confers no rights
    Tuesday, September 29, 2009 11:05 AM
  • Maybe I just like to live dangerously, but I have been beating my head against this problem for weeks.
    This is the first time I have see a registry-based solution and it doesn't look too dangerous to me (easily reversed).
    So, I took the plunge. And GUESS WHAT - IT WORKS!!!

    I have several different forms on my MOSS site that use both web service calls and the /_vti_bin/Users/simple.aspx list to populate form fields
    Before the fix, neither worked after being published to the site. Now, both types work.

    Thank you, timespeaks, thank you!

    • Proposed as answer by Life is good Monday, October 29, 2012 7:35 AM
    Thursday, October 1, 2009 8:45 PM
  • Hi Kevin,

    I have problem with "userProfileService.asmx" webservices

    It works fine in client application mode but not in Web page.

    I get error:

    the Error i get when the form is opened is

    "An error occurred accessing a data source.

    An entry has been added to the Windows event log of the server.
    Log ID:5566"


    I am using data Connection converting it to make UDC file in DCL in SharePoint where my infopath template is.
    I approved that UDC.

    My UDC file looks like this after some modification:

    <?xml version="1.0" ?>
      <?MicrosoftWindowsSharePointServices ContentTypeID="0x010100B4CBD48E029A4ad8B62CB0E41868F2B0"?>
    - <udc:DataSource MajorVersion="2" MinorVersion="0" xmlns:udc="http://schemas.microsoft.com/office/infopath/2006/udc">
      <udc:Name>GetUserProfileByName</udc:Name>
      <udc:Description>Format: UDC V2; Connection Type: WebService; Purpose: ReadOnly; Generated by Microsoft Office InfoPath 2007 on 2009-10-06 at 12:46:32 by Domain\userName.</udc:Description>
    - <udc:Type MajorVersion="2" MinorVersion="0" Type="WebService">
      <udc:SubType MajorVersion="0" MinorVersion="0" Type="" />
      </udc:Type>
    - <udc:ConnectionInfo Purpose="ReadOnly" AltDataSource="">
      <udc:WsdlUrl>https://site/_vti_bin/UserProfileService.asmx?WSDL</udc:WsdlUrl>
    - <udc:SelectCommand>
      <udc:ListId />
      <udc:WebUrl />
      <udc:ConnectionString />
      <udc:ServiceUrl UseFormsServiceProxy="true">site/_vti_bin/UserProfileService.asmx</udc:ServiceUrl>
      <udc:SoapAction>http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/GetUserProfileByName</udc:SoapAction>
      <udc:Query />
      </udc:SelectCommand>
    - <udc:UpdateCommand>
      <udc:ServiceUrl UseFormsServiceProxy="true" />
      <udc:SoapAction />
      <udc:Submit />
      <udc:FileName>UserName</udc:FileName>
      <udc:FolderName AllowOverwrite="" />
      </udc:UpdateCommand>
    - <udc:Authentication>
    - <udc:UseExplicit CredentialType="">
      <udc:UserId />
      <udc:Password />
      </udc:UseExplicit>
      <udc:SSO AppId="" CredentialType="" />
      </udc:Authentication>
      </udc:ConnectionInfo>
      </udc:DataSource>

    Am I missing anything.

    I really need to solve this problem as soon as possible. Kiven, it looks like you have solved this problem .


    Thank you
    BijNep
    • Edited by BijNep Friday, November 6, 2009 10:30 PM
    Thursday, October 8, 2009 7:12 PM
  • Hi BijNep ,

    I was also facing same issue . From IIS log , I found that InfoPath was not able to hit web service asmx file and was getting unauthorized error even though I had set anonymous access to web service.

    I resolved this error by giving below permissions to web service folder.

    1. Right click to web service folder ,Go to security tab .
    2. Give full permissions to Domain Users , Authenticated Users and everyone.



    Thanks
    Nilesh
    • Proposed as answer by Nielsh Wednesday, October 14, 2009 10:25 AM
    Wednesday, October 14, 2009 10:25 AM
  • Thank you Nielsh,

    It looks like I had authentication problem, I fixed that by SPN configuration.

    BijNep

    Friday, November 6, 2009 10:33 PM
  • Hi BijNep,

    Could you please tell me how to Configure SPN. I am having same problem but no solution at all..

    REgards,
    Karan
    • Proposed as answer by Victor Lam Friday, June 29, 2012 6:45 PM
    Thursday, November 12, 2009 6:54 AM
  • Thursday, November 12, 2009 7:17 PM
  • Hello Mister Goodwin,

    I have exactly the same issue and cannot get this form running. The very strange thing is, that it works for about a week (I cannot access the server, admins said they did not change anything) to crash again today morning. All in all very hard to find the problem, because I have no access to the logs and the server guys saying they did not change any configuration changes.

    Did you find a solution for that?

    I would highly appriciate any ideas on that issue!

    Thanks in advance
    Juergen Sl
    Tuesday, December 15, 2009 9:40 AM
  • Hi BijNep,

     

    How did you fix this issue. I have been searching all over the place and couldn't find the solution. Can you please let us know how did you do it?

     

    Thanks,

    Tuesday, May 18, 2010 2:40 AM
  • Hi There,

    I have run into some similar issues. I tried to open a form we have created using infopath and we get the following error:


    "There has been an error while processing the form.

    Click Continue to resume filling out the form. You may want to check your form data for errors.
    Click Start Over to load a new copy of the form.

    Error: An error occured accessing a data source."

    Our form has drop down lists that have the list of all our staff members. I assume its looking through the SQL Database (I am not the one who created the form, the creator has gone a long service leave)

    I looked at the sharepoint error logs in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS"

    and noticed this error message:

    The following query failed: Ody_Users (User: ODYSSEY\PaveThinamani, Form Name: Action Report, IP: , Request: http://portal/_layouts/FormServer.aspx?XsnLocation=http://portal/Sites/Bms/Docs/CARPAROFI/Forms/template.xsn&SaveLocation=http://portal/sites/bms/Docs/CARPAROFI&Source=http://portal/sites/bms/Docs/CARPAROFI/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:Action-Report:-myXSD-2005-10-21T21-12-27, Type: DataAdapterException, Exception Message: The database returns an error. Invalid object name 'dbo.TAB_ADUsers'.)    4090535c-02c2-4e74-bddb-4e6f1a241226

     

    Can any body please help me out here?

    Your help is much appreciated. :)

    Regards

    Pave

     

     

    Thursday, August 19, 2010 12:23 AM
  • How does your udc connection file looks like now? What did you in Secure Store.?
    Monday, October 24, 2011 2:52 PM