Hi,
Here is what I'm currently doing: I have inherited the provided SharePoint service and overrided the Execute method, so I can change the user name just before the Execute method of the base class where it is using it in order to set it as credentials of the sharepoint webservice call. Basically I'm checking if the user name is in the form Group:Domain\username if if this is the case I take everything after the ':' symbol. In the same method after the execute I have some other logic that is "fixing" the lookup column value to be only the key and not 'key#;value', so I can set the service links in order to impelement my composite smartobject. So as you can see the Execute method is very helpfull to me (I'm glad that I can override it, because otherwise I was going to be in big trouble :) ).
By the way just to let you know the credentials you specify when you define the service instance are being used only for the metadata generation during the registration and when you make the call to the service it is using the credentials of the client. I still need to confirm that but I tried to use different accounts (note: the password is stored in clear form in the metadata) and while I was debugging the service I can see that it is always using the account I'm logged in on the computer.
I also need to add some searching capabilities as the base service only has the Load method where the ID should be passed and I have a unique column I want to search by.
Here is some sample code. The assembly of the sharepoint service is located in the usual place --> {k2 folder}\ServiceBroker
public class SharePointService : SourceCode.SmartObjects.Services.SharePoint.SharePointService
{
public override void Execute()
{
string userName = this.Service.ServiceConfiguration.ServiceAuthentication.UserName;
if (userName.IndexOf("\\") != -1 && userName.IndexOf(":") != -1)
userName = userName.Substring(userName.IndexOf(":") + 1);
this.Service.ServiceConfiguration.ServiceAuthentication.UserName = userName;
base.Execute();
.........................................
}
}