SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am reading through this post Upload a file to SharePoint through the built-in web services where upload is done in WSS. I am using SP 2010. Is there a piece of code already posted here that will add an item (via .net interface) using foundation web-services where content type is "XYX" as the target library has about 8 CT associated with it. (with metadata, using hashtable). I would hate to re-invent the wheel if someone already went through this scenario. I forgot about what account to use (like a service account) or user authentication.

How do I add an item with metadata to library for a specific content type using webservices in SP2010?

share|improve this question
up vote 0 down vote accepted

You'll need to populate the FieldInformation array. Using the code from the linked question, here is an example:

// Populated FieldInformation!
SharePoint2007CopyService.FieldInformation information = new 
information.DisplayName = "Content Type";
information.InternalName = "ContentType";
information.Type = FieldType.Choice;
information.Value = "XYZ";

SharePoint2007CopyService.FieldInformation[] info = { information };

I typed this using the references below.. haven't tested yet. :)

See also:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.