Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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 
    SharePoint2007CopyService.FieldInformation();
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

 
discard

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.