locked
Error 5566 - rasied when opening a form in IE which has a XML document call to a sharepoint list RRS feed

  • Question

  • Hi,

    I have published and approved in central admin an infopath 2007 created form that get's some XML using this in the URL: 

    "_vti_bin/owssvr.dll"

    It does not work! :(

    It raised the 5566 error.

    I have not been able to see the error in the event viewer - the "use personal features" rights in the SSP is there - i've added a hostname in IIS for the intranet URL corresponding to that which is set in Alternate Access mappings...it did not work so i removed it - editing the registry was not needed - editing the web.config was not needed...

    Form has been published with full trust and digitally been signed - account accessing form has access to sharepoint list data - permissions are ok.

    Data is being accessed on the server the call is being made from. Call is from and to a sub-site where there are permissions.

     

    Help!

    Please...thanks!

     

    Monday, March 7, 2011 5:47 PM

Answers

  • Hi Wayne,

     

    That info was interesting but I used a different method to solve this - using c# as mentioned elsewhere in this forum here:

    http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/4f739cec-220e-4ab2-a6d9-13079e43844a

    Which I shall repeat here in case the link above does not work in the future:

    • This solution was from user: DaveC1982:
    • Even though further down this post it says the form language can be VB this is NOT true - it must be c#

     

    Quote starts:

    "Hi All,

    I spent the whole of this morning working out how to actualy do this and my solution was to sort my datasource in the FormEvents_Loading event method.

    • Add a FormEvents_Loading event handler and method by selecting Tools > Programming > Loading Event
    • Create a method SortDataSource which we will call from FormEvents_Loading like so :-

    public void FormEvents_Loading(object sender, LoadingEventArgs e)  
            {  
                SortDataSource();  
            } 

    • Here is the method that sorts the data.
        
        
              public void SortDataSource()  
              {  
       
                    // Creates an XPath Navigator copy of the datsource the drop down is bound to. Replace  
                    // Asset Register with the name of your datasource.  
                    XPathNavigator datasource = this.DataSources["Asset Register"].CreateNavigator();  
       
                    // Creates an XML document so we can create a namespace manager  
                    System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();  
                    xmlDoc.LoadXml(datasource.InnerXml);  
       
                    // Namespace manager so the the dfs namespace is recognised. Note this is because my   
                    // data source comes from a sharepoint list you may need to change the namespace values.  
                    XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);  
                    nsmgr.AddNamespace("dfs", "http://schemas.microsoft.com/office/infopath/2003/dataFormSolution");  
       
                    // Create tje XPathExpression that can be used to sort the XML  
                    XPathExpression expr;  
                    // Replace dfs:myFields/dfs:dataFields/dfs:Asset_Register with the XPath to your  
                    // datasource can be found by selcting properties of your dropdown  
                    // copy the value from the Entries field on the data tab remove the first /  
                    expr = datasource.Compile("dfs:myFields/dfs:dataFields/dfs:Asset_Register");  
                    expr.SetContext(nsmgr);  
       
                    // change @Asset_Title to the value you want to sort by can be found by  
                    // selcting properties of your dropdown copy the value from the Display name field  
                    expr.AddSort("@Asset_Title", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text);  
       
                    // Executes the sort  
                    XPathNodeIterator iterator = datasource.Select(expr);  
                    
                    // Group 1 used to add the sorted data to the datasource change value realtive to above  
                    XPathNavigator group1 = datasource.SelectSingleNode("//dfs:myFields/dfs:dataFields", nsmgr);  
                    // Group 2 used to delete the sorted data change value realtive to above  
                    XPathNavigator group2 = datasource.SelectSingleNode("//dfs:myFields/dfs:dataFields/dfs:Asset_Register", nsmgr);  
       
                    // Count the number of items so we can delete them all.  
                    XPathNodeIterator iter = datasource.Select("//dfs:myFields/dfs:dataFields/dfs:Asset_Register", nsmgr);  
                    int group2NodesCount = iter.Count;  
       
                    // Find the last node to delete and delete.  
                    XPathNavigator field1 = datasource.SelectSingleNode("//dfs:myFields/dfs:dataFields/dfs:Asset_Register[" + group2NodesCount.ToString() + "]", nsmgr);  
                    group2.DeleteRange(field1);  
       
                    // Add the sorted data via group 1.  
                    foreach (XPathNavigator item in iterator)  
                    {  
                        group1.AppendChild(item.OuterXml);  
                    }  
                            
              } 

    This has been driving me, and going by other posts on the internet alot of other people, mad!! I haven't refactored my code yet this was my first attempt, I will be creating a reusuable methods that I can pass values to for differnent datasources and probably renaming some of my objects. But feel free to give it a try hope it helps someone!"

     

    • Marked as answer by xyz2012 Wednesday, March 9, 2011 10:53 AM
    Wednesday, March 9, 2011 10:52 AM

All replies

  • Hi,

    I've got the error a long time ago.

    If I remembre, it became from a data connection of the form that was not correct (bad url, etc).

    Try to delete all your data connection to check if it is the cause of your problem.

     

    Hope this helps


    Visit my blog : http://rmatayron.blogspot.com/
    Monday, March 7, 2011 9:11 PM
  • Hi xyz2012,

     

    Thanks for your post.

    I agree with matayron’s idea. Here are some solutions about this issue.

    http://blogs.msdn.com/b/hakaneren/archive/2009/02/19/resolving-infopath-5566-error.aspx

    http://www.dotnetking.com/TechnicalComments.aspx?LogID=336

     

    Share your result.

     

    Thanks,

    Wayne

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com

    Tuesday, March 8, 2011 2:06 AM
  • The url does work as i have tested it in a browser and it returns xml...

    Wayne; The 1st link i have not yet looked at but the 2nd one i was looking at for much of yesterday.

     

    Thanks.

    Tuesday, March 8, 2011 10:34 AM
  • Wayne: Even though I had not looked at the 2nd link when writing previous post everything on there i have already done such as:

    • You call the web service at a site or site collection level (eg: h ttp://myserver/mysitecollection/_vti_bin/UserProfileService.asmx) 
    • I AM NOT USING THE USER PROFILE SERVICE - HOWEVER I AM CALLING THE XML FROM THE LOCATION IT IS IN
    • The user who is opening the form has access to the subject site collection
    • YES I HAVE ACCESS
    • Anonymous access is disabled through Central Admin
    • IT IS DISABLED
    • In the web applications web.config file you have Proxy AutoDetect = false (on many cases I could leave this the default value true without a problem)
    • IT IS FALSE
    • If you have multiple web front ends, depending on your configuration you might have to add an entry to the hosts file (Eg: MyMOSS 127.0.0.1) so that InfoPath Form services calls the web service on the same server avoiding NLB..
    • NO I DO NOT HAVE MANY WFEs
    • If you made the above change be sure that the address you add (MyMOSS) is the same name that you assign in IIS for that application. Basically it should be the same address clients are using.
    • THIS DOES NOT APPLY
    • Before applying the above steps you can have a look at the IIS logs.
    • NOTHING IN THE LOGS TALKS OF ERROR 5566

    If anyone else has any ideas please let me know. This server uses SSL by the way so that the URL is https:// - hmmm.

     

     

     

    Tuesday, March 8, 2011 10:41 AM
  • Since you're using SSL do you have your Alternate Access Mappings configured (properly)?:

    http://technet.microsoft.com/en-us/library/cc288173(office.12).aspx

    Tuesday, March 8, 2011 3:21 PM
  • Thanks for the suggestion - I did look earlier today but am not 100% sure they are correct - I'll review the link and have another look.

    As a test earlier today I made a web app (and new site collection) on the dev install without any SSL and it worked fine.

    Hence the issue is caused by SSL being used.

    I can not turn it off though - I have to find a way to get round it - maybe AAM's are the answer?

     

     

    Tuesday, March 8, 2011 5:08 PM
  • Hi xyz2012,

     

    Glad to receive your reply.

     

    I agree with you. The SSL and Data Connection is the reason for the issue.

    Here is a KB article about this issue:

    You create a Microsoft Office InfoPath 2007 form template that has a data connection to a SharePoint list on the SSL-secured site.

    In this scenario, you may receive the error message.

    More information:

    http://support.microsoft.com/kb/980213

     

    Thanks,

    Wayne

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com

    Wednesday, March 9, 2011 2:14 AM
  • Hi Wayne,

     

    That info was interesting but I used a different method to solve this - using c# as mentioned elsewhere in this forum here:

    http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/4f739cec-220e-4ab2-a6d9-13079e43844a

    Which I shall repeat here in case the link above does not work in the future:

    • This solution was from user: DaveC1982:
    • Even though further down this post it says the form language can be VB this is NOT true - it must be c#

     

    Quote starts:

    "Hi All,

    I spent the whole of this morning working out how to actualy do this and my solution was to sort my datasource in the FormEvents_Loading event method.

    • Add a FormEvents_Loading event handler and method by selecting Tools > Programming > Loading Event
    • Create a method SortDataSource which we will call from FormEvents_Loading like so :-

    public void FormEvents_Loading(object sender, LoadingEventArgs e)  
            {  
                SortDataSource();  
            } 

    • Here is the method that sorts the data.
        
        
              public void SortDataSource()  
              {  
       
                    // Creates an XPath Navigator copy of the datsource the drop down is bound to. Replace  
                    // Asset Register with the name of your datasource.  
                    XPathNavigator datasource = this.DataSources["Asset Register"].CreateNavigator();  
       
                    // Creates an XML document so we can create a namespace manager  
                    System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();  
                    xmlDoc.LoadXml(datasource.InnerXml);  
       
                    // Namespace manager so the the dfs namespace is recognised. Note this is because my   
                    // data source comes from a sharepoint list you may need to change the namespace values.  
                    XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);  
                    nsmgr.AddNamespace("dfs", "http://schemas.microsoft.com/office/infopath/2003/dataFormSolution");  
       
                    // Create tje XPathExpression that can be used to sort the XML  
                    XPathExpression expr;  
                    // Replace dfs:myFields/dfs:dataFields/dfs:Asset_Register with the XPath to your  
                    // datasource can be found by selcting properties of your dropdown  
                    // copy the value from the Entries field on the data tab remove the first /  
                    expr = datasource.Compile("dfs:myFields/dfs:dataFields/dfs:Asset_Register");  
                    expr.SetContext(nsmgr);  
       
                    // change @Asset_Title to the value you want to sort by can be found by  
                    // selcting properties of your dropdown copy the value from the Display name field  
                    expr.AddSort("@Asset_Title", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text);  
       
                    // Executes the sort  
                    XPathNodeIterator iterator = datasource.Select(expr);  
                    
                    // Group 1 used to add the sorted data to the datasource change value realtive to above  
                    XPathNavigator group1 = datasource.SelectSingleNode("//dfs:myFields/dfs:dataFields", nsmgr);  
                    // Group 2 used to delete the sorted data change value realtive to above  
                    XPathNavigator group2 = datasource.SelectSingleNode("//dfs:myFields/dfs:dataFields/dfs:Asset_Register", nsmgr);  
       
                    // Count the number of items so we can delete them all.  
                    XPathNodeIterator iter = datasource.Select("//dfs:myFields/dfs:dataFields/dfs:Asset_Register", nsmgr);  
                    int group2NodesCount = iter.Count;  
       
                    // Find the last node to delete and delete.  
                    XPathNavigator field1 = datasource.SelectSingleNode("//dfs:myFields/dfs:dataFields/dfs:Asset_Register[" + group2NodesCount.ToString() + "]", nsmgr);  
                    group2.DeleteRange(field1);  
       
                    // Add the sorted data via group 1.  
                    foreach (XPathNavigator item in iterator)  
                    {  
                        group1.AppendChild(item.OuterXml);  
                    }  
                            
              } 

    This has been driving me, and going by other posts on the internet alot of other people, mad!! I haven't refactored my code yet this was my first attempt, I will be creating a reusuable methods that I can pass values to for differnent datasources and probably renaming some of my objects. But feel free to give it a try hope it helps someone!"

     

    • Marked as answer by xyz2012 Wednesday, March 9, 2011 10:53 AM
    Wednesday, March 9, 2011 10:52 AM