I'd like to know if anyone is having issues getting group information when InfoPath 2010 connects to the UserGroup web service in SharePoint 2010. What I'm trying to do is figure out if the current user is a member of a certain group in a SharePoint subsite. I've followed the many excellent blog posts including the following one
http://jaliyaudagedara.blogspot.com/2011/05/getting-current-users-sharepoint-group.html. However nothing seemed to be working for me, so I did a little more digging into the situation. I launched Fiddler and could see that the SOAP response came back with an error "No Such Group found," which I found odd.
The form has a SOAP data connection back to the following URL http://myserver/sites/subsite/subsite1/_vti_bin/UserGroup.asmx. When I make the call to GetUserCollectionByGroup, I get nothing back.
On a whim I decided to whip up a console application to consume the web service. What I've noticed is that instead of going to the subsite to gather it's information, it seems to be going to the root web application http://myserver , even when the web service reference pointed to the subsite. Within the console application, I can get it to work by setting the URL property, however I can't seem to figure out if setting the URL is even possible in InfoPath code behind ( I was planning on executing the connection on the onLoading event).
Anyone have any suggestions for getting around this issue?