If like me you have spent the past couple of hours struggling to get past 401 Unauthorized errors when attempting to call SharePoint webservices via InfoPath, take a look at the following blog post from Susan Hernandez.
There are a lot of crazy posts out their explaining that InfoPath doesn’t understand the fully claims based model of authentication that comes as standard in SharePoint 2013. Some of them also go on to describe some fairly dubious approaches to getting round the problem. Susan has done a fantastic post that explains how you can use a combination of a Secure Store entry and a data connection file to get yourself authenticated with SharePoint 2013 web services. The approach described seems far more sensible than some of the others:
I haven’t fully tested the ins and outs of this approach. I’m not entirely sure if it can be used to call a web service where the calling user’s identity is important to the service result.
For web service calls where the caller’s identity is not relevant then this approach did the trick for me