Hello, recently I've developed a web service that, when users enter specific info on a website, it calls the web-service which then loads a from template (that is published on a sharepoint lib) from the disc (I extracted the template.xml from the xsn file), then it populates the fields in the form based on user input, and uploads the form to a form library, all done programaticly. This is now working but I'm not satisfied with the process, or I think it can be done more elegantly.
What I would like to do, is to programaticly get the template.xml from the sharepoint library(when ever the form is updated i need to replace the old xml with the new one), now there are ways of doing this using external extractors wich I cannot use. Is there a fucntion or a .net library that does this or is there a better way of doing this, couse Im not shure if this is the best approach.
BTW I can get to the xsn file in the library.
using (SPSite site = new SPSite(siteUrl)
site.AllowUnsafeUpdates = true;
using (SPWeb currWeb = site.OpenWeb())
list = currWeb.Lists[libraryName];
SPXmlDocumentCollection collection = ContentTypes[formName].XmlDocuments;
Thanks for your answers!