My process currently has a server event that runs the following c# code to create a document library based on a custom template (K2 standard wizard does not allow for this):
SPSite mySite = new SPSite("url");
SPWeb s = mySite.OpenWeb();
SPListTemplateCollection listTemplates = mySite.GetCustomListTemplates(s);
SPListTemplate listTemplate = listTemplatese"CustomTemplateName"];
s.Lists.Add("libraryname", "description", listTemplate);
This works fine when K2 and SharePoint are on the same server but when they are not, I need to use the SharePoint web service 'AddList' instead. How do I do this? Do I add a web reference to the process's references and then just change my code above to reference this instead? Or is there another 'K2 way'.
Thank you.