If you were using InfoPath forms to connect to a data source like web service in SP2010 and it was working fine, after upgrading to SP2013 if it throws error like this “An error occurred while trying to connect to a Web service” (Log ID:5566), don’t be surprised. In SP15 claims-based authentication is the default authentication mode for web applications unless it’s created otherwise using PowerShell or SP OM.
The forms services template which is hosted on a claims based authentication web application do not leverage the Claims to Windows Token Service (c2WTS) and so are unable to authenticate to backend data source like the web service.
To get around this issue, you can use Secure Store Service, where InfoPath Forms Services requests Secure Store Service authentications on behalf of a user. The InfoPath Forms Services uses the appropriate credentials to impersonate the user. The Web service sees that the user is specified in the Secure Store Service database even if the specified user is not the actual user.