InfoPath 2010 form with REST call gives error when published to SharePoint 2010 - InfoPath Dev
in

InfoPath Dev

InfoPath 2010 form with REST call gives error when published to SharePoint 2010

Last post 08-02-2013 02:59 AM by RaYvA. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-18-2013 11:14 AM

    InfoPath 2010 form with REST call gives error when published to SharePoint 2010

    I created an Infopath 2010 form based on a SharePoint 2010 list.  I did this by clikcing on the "Customize form [in InfoPath]" button on the List Tootls > List menu.  I added a REST call to a service on another, non-Sharepoint server.  When I run the form in InfoPath 2010 Designer, the REST calls work fine.  When I publish the form to SharePoint, I get an error when the form loads.  Without the REST calls, the form works fine in SharePoint.

    The error on the client browser is "XML data that is required for this form to function correctly cannot be found."   When I check the SP server for the corresponding error, it says:  "The form cannot run the specified query. The remote server returned an error: (404) Not Found".

    The data connections were all converted to udcx Connection Files and posted on the same site that the form is published to.

    When I run just the rest call from a browser on my client or on the Sharepoint server, it returns the correct value. But from SP, the form just errors out.

    If I run the form from SharePoint on the SharePoint server itself, it fails when I use //<servername>/sitepages/form.aspx but the form and REST work fine if I instead use localhost from the sharepoint server: //localhost/sitepages/form.aspx.  I don't know how to fix this.

    I sniffed the traffic and see that when I use the localhost adress, the webservice server gets the request and returns a value.  When I use the servername address, the webservice  server never receives a call at all (hence the  (404) Not Found error).  When I sniff the traffic from the sharepoint sever, I dont see the REST call at all when the servername address is used. 

    Other information:  REST service queries and totals a SP list.  REST service is used because user wants a count of the number of entries for the current month.  REST service requires no authentication.  I have disabled loopbacks.  In central admin, I have enabled "Allow cross-domain data access for user form templates" and "Allow user form templates to use authentication information contained in data connection files".

    Any insight is appreciated.  I have read a number of postings and tried a number of things, but most issues I read don't seem exactly the same.

  • 04-21-2013 09:51 AM In reply to

    Re: InfoPath 2010 form with REST call gives error when published to SharePoint 2010

    Try to paste the URL for the REST query into your browser. What do you get? If this fails, it's not related to InfoPath but rather how your server is configured.

    Patrick Halstead
    Project Manager at Qdabra
  • 04-22-2013 01:32 PM In reply to

    Re: InfoPath 2010 form with REST call gives error when published to SharePoint 2010

    Thanks for responding, Patrick.  When I put the URL in a browser it responds with the correct answer.  It works from a local browser and from a browser on the SharePoint server and on the web service server. 

    It's a simple call: ServerName/BiwebServices/WHSDataService.svc/GetDeliveryTotalNumber

    Returns:

    <?xml version="1.0" encoding="utf-8" ?>

        <d:GetDeliveryTotalNumber xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:type="Edm.Double">4</d:GetDeliveryTotalNumber>
     
      Am I missing something?  Is it because I created the form from the SP list as the edit form?  Is there a sharepoint server setting I need?  If there are any settings you want me to check or code to provide let me know. 
  • 07-30-2013 03:59 PM In reply to

    • RaYvA
    • Top 100 Contributor
    • Joined on 05-08-2013
    • Melbourne, Australia
    • Posts 86

    Re: InfoPath 2010 form with REST call gives error when published to SharePoint 2010

    It is quiet possible that this is related to the 'Double Hop' issue because you do not having Kerberos enabled! If you have more than one server and you create a REST data source/call to a list on another server Sharepoint is unable pass your credentials on when using the default NTLM authentication mechanism. Setting up Kerberos in your environment isn't a tivial thing and can be quiet complicated (depending on your environment that is!).
  • 08-01-2013 10:50 PM In reply to

    Re: InfoPath 2010 form with REST call gives error when published to SharePoint 2010

    Thanks RaYvA. We're seeing more issues with REST these days. I wonder if it's because of this....

    Patrick Halstead
    Project Manager at Qdabra
  • 08-02-2013 02:59 AM In reply to

    • RaYvA
    • Top 100 Contributor
    • Joined on 05-08-2013
    • Melbourne, Australia
    • Posts 86

    Re: InfoPath 2010 form with REST call gives error when published to SharePoint 2010

    When you see...

    'a [REST/OTHER] call to a service ON ANOTHER [Sharepoint/non-Sharepoint] SERVER' - It's 90% of the time authentication.

    Then 'When I run the form in InfoPath 2010 Designer, the REST calls work fine.' - Everything on the desktop works fine, it's 99% of the time authentication.

    And then 'When I publish the form to SharePoint, I get an error when the form loads' - Client to Server to Server calls - 100% authentication

    Anonymous calls to REST services should work fine btw.

    Check this post for more details (if you haven't already started a little research) http://blogs.msdn.com/b/besidethepoint/archive/2010/05/09/double-hop-authentication-why-ntlm-fails-and-kerberos-works.aspx

    I have this issue in my current environment, multiple farms, multiple site collections, numerous servers and everyone wants to share data! It's horrific!

    Plan for Kerberos authentication (SharePoint Server 2010) - http://technet.microsoft.com/en-us/library/ee806870(v=office.14).aspx#section1

    Configuring Kerberos Authentication for Microsoft SharePoint 2010 Products - http://www.microsoft.com/en-us/download/details.aspx?id=23176
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.