Export (0) Print
Expand All

4.1 New Content Type

SharePoint

Overall scenario: A protocol client wants to discover which content types exist on a protocol server and choose one from which to retrieve all data.

A protocol client that does not know of any content type identifiers on a protocol server uses the GetListContentTypes operation (section 3.1.4.18) to determine which content types exist on the list. The list needs to be known before this protocol can be used, such as by using GetListCollection (section 3.1.4.17).

A sample request is similar to the following:

<?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
   <GetListContentTypes xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <listName>{C7A6517B-BC8E-4937-B405-FC2EB2F88736}</listName>
    <contentTypeId></contentTypeId>
   </GetListContentTypes>
  </soap:Body>
</soap:Envelope>

A sample response is similar to the following (white space added for readability):

<?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
   <GetListContentTypesResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <GetListContentTypesResult>
     <ContentTypes>
      <ContentType Name="Document" ID="0x010100953225EF09D1E743BA2FD70C51A612DE" Description="Create a new document." Scope="http://server-test5/CT Doc Lib" Version="0">
       <XmlDocuments>
        <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
         <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Display>DocumentLibraryForm</Display>
          <Edit>DocumentLibraryForm</Edit>
          <New>DocumentLibraryForm</New>
        </FormTemplates>
       </XmlDocument>
      </XmlDocuments>
     </ContentType>
     <ContentType Name="Folder" ID="0x012000AA08B7BC1F57FD4D80C737A837E5069F" Description="Create a new folder." Scope="http://server-test5/CT Doc Lib" Version="0">
      <XmlDocuments>
       <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
         <Display>ListForm</Display>
         <Edit>ListForm</Edit>
         <New>ListForm</New>
        </FormTemplates>
       </XmlDocument>
      </XmlDocuments>
     </ContentType>
     <ContentType Name="Dublin Core Columns" ID="0x01010B00818A37E4A8A29B4E80B97DDDB6F45D8E" Description="The Dublin Core metadata element set." Scope="http://server-test5/CT Doc Lib" Version="1">
      <XmlDocuments>
       <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
         <Display>DocumentLibraryForm</Display>
         <Edit>DocumentLibraryForm</Edit>
         <New>DocumentLibraryForm</New>
        </FormTemplates>
       </XmlDocument>
      </XmlDocuments>
     </ContentType>
    </ContentTypes>
   </GetListContentTypesResult>
  </GetListContentTypesResponse>
 </soap:Body>
</soap:Envelope>

The response of the server includes three content types: 0x010100953225EF09D1E743BA2FD70C51A612DE, 0x012000AA08B7BC1F57FD4D80C737A837E5069F, and 0x01010B00818A37E4A8A29B4E80B97DDDB6F45D8E. The response can be used to receive more information about the "Dublin Core Columns" by using the GetListContentType method.

A sample request for this content type is similar to the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
  <GetListContentType xmlns="http://schemas.microsoft.com/sharepoint/soap/">
   <listName>{C7A6517B-BC8E-4937-B405-FC2EB2F88736}</listName>
   <contentTypeId>0x01010B00818A37E4A8A29B4E80B97DDDB6F45D8E</contentTypeId>
  </GetListContentType>
 </soap:Body>
</soap:Envelope>

This request uses the content type identifier that was received from the GetListContentTypes method to retrieve information about the "Dublin Core Columns" content type.

A sample response from the server is similar to the following (white spaced added for readability):

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
  <GetListContentTypeResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
   <GetListContentTypeResult>
    <ContentType ID="0x01010B00818A37E4A8A29B4E80B97DDDB6F45D8E" Name="Dublin Core Columns" Group="Document Content Types" Description="The Dublin Core metadata element set." Version="1" FeatureId="{695b6570-a48b-4a8e-8ea5-26ea7fc1d162}">
     <Folder TargetName="Forms/Dublin Core Columns"/>
     <Fields>
      <Field RowOrdinal="0" Type="Choice" Format="Dropdown" FillInChoice="FALSE" Sealed="FALSE" Name="ContentType" ColName="tp_ContentType" SourceID="http://schemas.microsoft.com/sharepoint/v3" ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" DisplayName="Content Type" StaticName="ContentType" Group="_Hidden" PITarget="MicrosoftWindowsSharePointServices" PIAttribute="ContentTypeID">
       <Default>Document</Default>
       <CHOICES>
        <CHOICE>Document</CHOICE>
        <CHOICE>Folder</CHOICE>
        <CHOICE>Dublin Core Columns</CHOICE>
       </CHOICES>
      </Field>
      <Field ID="{5f47e085-2150-41dc-b661-442f3027f552}" ReadOnly="TRUE" Type="Computed" Name="SelectFilename" DisplayName="Select" Hidden="TRUE" CanToggleHidden="TRUE" Sortable="FALSE" Filterable="FALSE" AuthoringInfo="(web part connection)" HeaderImage="blank.gif" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="SelectFilename" FromBaseType="TRUE">
       <FieldRefs>
        <FieldRef Name="ID"/>
       </FieldRefs>
       <DisplayPattern>
       <IfEqual>
        <Expr1>
         <GetVar Name="SelectedID"/>
        </Expr1>
        <Expr2>
         <Column Name="ID"/>
        </Expr2>
        <Then>
         <HTML><![CDATA[<img align="absmiddle" style="cursor: pointer" src="/_layouts/images/rbsel.gif" alt="]]>
</HTML>
         <HTML>Selected</HTML>
         <HTML><![CDATA[">]]></HTML>
        </Then>
        <Else>
         <HTML><![CDATA[<a href="javascript:SelectField(']]></HTML>
         <GetVar Name="View"/>
         <HTML><![CDATA[',']]></HTML>
         <ScriptQuote NotAddingQuote="TRUE">
          <Column Name="ID"/>
         </ScriptQuote>
         <HTML><![CDATA[');return false;" onclick="javascript:SelectField(']]></HTML>
         <GetVar Name="View"/>
         <HTML><![CDATA[',']]></HTML>
         <ScriptQuote NotAddingQuote="TRUE">
          <Column Name="ID"/>
         </ScriptQuote>
         <HTML><![CDATA[');return false;" target="_self">]]></HTML>
         <HTML><![CDATA[<img border="0" align="absmiddle" style="cursor: pointer" src="/_layouts/images/rbunsel.gif"  alt="]]></HTML>
         <HTML>Normal</HTML>
         <HTML><![CDATA[">]]></HTML>
         <HTML><![CDATA[</a>]]></HTML>
        </Else>
       </IfEqual>
      </DisplayPattern>
     </Field>
     <Field ID="{8553196d-ec8d-4564-9861-3dbe931050c8}" ShowInFileDlg="FALSE" ShowInVersionHistory="FALSE" Type="File" Name="FileLeafRef" DisplayName="Name" AuthoringInfo="(for use in forms)" List="Docs" FieldRef="ID" ShowField="LeafName" JoinColName="DoclibRowId" JoinRowOrdinal="0" JoinType="INNER" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="FileLeafRef" FromBaseType="TRUE"/>
     <Field ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}" ColName="tp_Created" RowOrdinal="0" ReadOnly="TRUE" Type="DateTime" Name="Created" DisplayName="Created" StorageTZ="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Created" FromBaseType="TRUE" Hidden="TRUE"/>
     <Field ID="{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}" ColName="tp_Modified" RowOrdinal="0" ReadOnly="TRUE" Type="DateTime" Name="Modified" DisplayName="Modified" StorageTZ="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Modified" FromBaseType="TRUE" Hidden="TRUE"/>
     <Field ID="{822c78e3-1ea9-4943-b449-57863ad33ca9}" ReadOnly="TRUE" Hidden="FALSE" Type="Text" Name="Modified_x0020_By" DisplayName="Document Modified By" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Modified_x0020_By" FromBaseType="TRUE" ColName="nvarchar1"/>
     <Field ID="{4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb}" ReadOnly="TRUE" Hidden="FALSE" Type="Text" Name="Created_x0020_By" DisplayName="Document Created By" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Created_x0020_By" FromBaseType="TRUE" ColName="nvarchar2"/>
     <Field ID="{370B7779-0344-4b9f-8F2D-DC1C62EAE801}" Type="Note" NumLines="2" Group="Core Document Columns" Name="_Contributor" DisplayName="Contributor" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Contributor" Description="One or more people or organizations that contributed to this resource" Customization="" ColName="ntext2" RowOrdinal="0"/>
     <Field ID="{3B1D59C0-26B1-4de6-ABBD-3EDB4E2C6ECA}" Type="Text" Group="Core Document Columns" Name="_Coverage" DisplayName="Coverage" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Coverage" Description="The extent or scope" Customization="" ColName="nvarchar10" RowOrdinal="0"/>
     <Field ID="{246D0907-637C-46b7-9AA0-0BB914DAA832}" Name="_Author" Group="Core Document Columns" Type="Text" DisplayName="Creator" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Author" Description="The primary author" Sealed="TRUE" AllowDeletion="TRUE" ShowInFileDlg="FALSE" Customization="" ColName="nvarchar11" RowOrdinal="0"/>
     <Field ID="{9F8B4EE0-84B7-42c6-A094-5CBDE2115EB9}" Type="DateTime" Format="DateTime" Group="Core Document Columns" Name="_DCDateCreated" DisplayName="Date Created" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_DCDateCreated" Description="The date on which this resource was created" Customization="" ColName="datetime1" RowOrdinal="0"/>
<Field ID="{810DBD02-BBF5-4c67-B1CE-5AD7C5A512B2}" Type="DateTime" Format="DateTime" Group="Core Document Columns" Name="_DCDateModified" DisplayName="Date Modified" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_DCDateModified" Description="The date on which this resource was last modified" Customization="" ColName="datetime2" RowOrdinal="0"/>
     <Field ID="{52578FC3-1F01-4f4d-B016-94CCBCF428CF}" Name="_Comments" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="_Comments" Group="Core Document Columns" Type="Note" DisplayName="Description" Sortable="FALSE" Description="A summary of this resource" Sealed="TRUE" UnlimitedLengthInDocumentLibrary="TRUE" AllowDeletion="TRUE" ShowInFileDlg="FALSE" Customization="" ColName="ntext3" RowOrdinal="0"/>
     <Field ID="{36111FDD-2C65-41ac-B7EF-48B9B8DA4526}" Type="Text" Group="Core Document Columns" Name="_Format" DisplayName="Format" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Format" Description="Media-type, file format or dimensions" Customization="" ColName="nvarchar12" RowOrdinal="0"/>
     <Field ID="{3C76805F-AD45-483a-9C85-7AC24506CE1A}" Type="Text" Group="Core Document Columns" Name="_Identifier" DisplayName="Resource Identifier" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Identifier" Description="An identifying string or number, usually conforming to a formal identification system" Customization="" ColName="nvarchar13" RowOrdinal="0"/>
     <Field ID="{D81529E8-384C-4ca6-9C43-C86A256E6A44}" Name="Language" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Language" Group="Base Columns" Type="Choice" DisplayName="Language" FillInChoice="TRUE" Customization="" ColName="nvarchar14" RowOrdinal="0">
      <CHOICES>
       <CHOICE>Arabic (Saudi Arabia)</CHOICE>
       <CHOICE>Bulgarian (Bulgaria)</CHOICE>
       <CHOICE>Chinese (Hong Kong S.A.R.)</CHOICE>
       <CHOICE>Chinese (PRC)</CHOICE>
       <CHOICE>Chinese (Taiwan)</CHOICE>
       <CHOICE>Croatian (Croatia)</CHOICE>
       <CHOICE>Czech (Czech Republic)</CHOICE>
       <CHOICE>Danish (Denmark)</CHOICE>
       <CHOICE>Dutch (Netherlands)</CHOICE>
       <CHOICE>English</CHOICE>
       <CHOICE>Estonian (Estonia)</CHOICE>
       <CHOICE>Finnish (Finland)</CHOICE>
       <CHOICE>French (France)</CHOICE>
       <CHOICE>German (Germany)</CHOICE>
       <CHOICE>Greek (Greece)</CHOICE>
       <CHOICE>Hebrew (Israel)</CHOICE>
       <CHOICE>Hindi (India)</CHOICE>
       <CHOICE>Hungarian (Hungary)</CHOICE>
       <CHOICE>Indonesian (Indonesia)</CHOICE>
       <CHOICE>Italian (Italy)</CHOICE>
       <CHOICE>Japanese (Japan)</CHOICE>
       <CHOICE>Korean (Korea)</CHOICE>
       <CHOICE>Latvian (Latvia)</CHOICE>
       <CHOICE>Lithuanian (Lithuania)</CHOICE>
       <CHOICE>Malay (Malaysia)</CHOICE>
       <CHOICE>Norwegian (Bokmal) (Norway)</CHOICE>
       <CHOICE>Polish (Poland)</CHOICE>
       <CHOICE>Portuguese (Brazil)</CHOICE>
       <CHOICE>Portuguese (Portugal)</CHOICE>
       <CHOICE>Romanian (Romania)</CHOICE>
       <CHOICE>Russian (Russia)</CHOICE>
       <CHOICE>Serbian (Latin) (Serbia)</CHOICE>
       <CHOICE>Slovak (Slovakia)</CHOICE>
       <CHOICE>Slovenian (Slovenia)</CHOICE>
       <CHOICE>Spanish (Spain)</CHOICE>
       <CHOICE>Swedish (Sweden)</CHOICE>
       <CHOICE>Thai (Thailand)</CHOICE>
       <CHOICE>Turkish (Turkey)</CHOICE>
       <CHOICE>Ukrainian (Ukraine)</CHOICE>
       <CHOICE>Urdu (Islamic Republic of Pakistan)</CHOICE>
       <CHOICE>Vietnamese (Vietnam)</CHOICE>
      </CHOICES>
      <Default>English</Default>
     </Field>
     <Field ID="{2EEDD0AE-4281-4b77-99BE-68F8B3AD8A7A}" Type="Text" Group="Core Document Columns" Name="_Publisher" DisplayName="Publisher" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Publisher" Description="The person, organization or service that published this resource" Customization="" ColName="nvarchar15" RowOrdinal="0"/>
     <Field ID="{5E75C854-6E9D-405d-B6C1-F8725BAE5822}" Type="Note" NumLines="2" Group="Core Document Columns" Name="_Relation" DisplayName="Relation" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Relation" Description="References to related resources" Customization="" ColName="ntext4" RowOrdinal="0"/>
     <Field ID="{ADA3F0CB-6F95-4588-BB08-D97CC0623522}" Type="Note" NumLines="2" Group="Core Document Columns" Name="_RightsManagement" DisplayName="Rights Management" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_RightsManagement" Description="Information about rights held in or over this resource" Customization="" ColName="ntext5" RowOrdinal="0"/>
     <Field ID="{B0A3C1DB-FAF1-48f0-9BE1-47D2FC8CB5D6}" Type="Note" NumLines="2" Group="Core Document Columns" Name="_Source" DisplayName="Source" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_Source" Description="References to resources from which this resource was derived" Customization="" ColName="ntext6" RowOrdinal="0"/>
     <Field ID="{B66E9B50-A28E-469b-B1A0-AF0E45486874}" Type="Note" Group="Core Document Columns" Name="Keywords" DisplayName="Keywords" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="Keywords" Sealed="TRUE" NumLines="1" UnlimitedLengthInDocumentLibrary="TRUE" AllowDeletion="TRUE" ShowInFileDlg="FALSE" Customization="" ColName="ntext7" RowOrdinal="0"/>
     <Field ID="{76A81629-44D4-4ce1-8D4D-6D7EBCD885FC}" Name="Subject" Group="Core Document Columns" Type="Text" DisplayName="Subject" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="Subject" Sealed="TRUE" AllowDeletion="TRUE" ShowInFileDlg="FALSE" Customization="" ColName="nvarchar16" RowOrdinal="0"/>
     <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" ShowInNewForm="FALSE" ShowInFileDlg="FALSE" DisplayName="Title" Sealed="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" ColName="nvarchar7"/>
     <Field ID="{EDECEC70-F6E2-4c3c-A4C7-F61A515DFAA9}" Type="Text" Group="Core Document Columns" Name="_ResourceType" DisplayName="Resource Type" SourceID="http://schemas.microsoft.com/sharepoint/v3/fields" StaticName="_ResourceType" Description="A set of categories, functions, genres or aggregation levels" Customization="" ColName="nvarchar17" RowOrdinal="0"/>
    </Fields>
    <DocumentTemplate TargetName="Forms/Dublin Core Columns/template.doc"/>
    <XmlDocuments>
     <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
      <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
       <Display>DocumentLibraryForm</Display>
       <Edit>DocumentLibraryForm</Edit>
       <New>DocumentLibraryForm</New>
      </FormTemplates>
     </XmlDocument>
    </XmlDocuments>
   </ContentType>
  </GetListContentTypeResult>
 </GetListContentTypeResponse>
</soap:Body>
</soap:Envelope>

This response contains all the data about the content type requested.

Assume that the user wants to create a new content type on the list "Tokyo Project" for documents relating to travel expenses for the Tokyo project. The user wants this content type to be called "Tokyo Travel Expenses" with the description "Document related to travel expenses for the Tokyo Project" and wants the content type to inherit from the existing site content type "Travel Document", which has content type identifier 0x010100D0C022956380194BB5407321762A3E3F. The protocol client makes the following request:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CreateContentType xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>Tokyo Project</listName>
      <displayName>Tokyo Travel Expenses</displayName>
      <parentType>0x010100D0C022956380194BB5407321762A3E3F</parentType>
      <fields></fields>
      <contentTypeProperties>
        <ContentType Title="Tokyo Travel Expenses" Description="Document related to travel expenses for the Tokyo Project" />
      </contentTypeProperties>
    </CreateContentType>
  </soap:Body>
</soap:Envelope>

The protocol client receives the following response from the protocol server:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <CreateContentTypeResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <CreateContentTypeResult>0x010100D0C022956380194BB5407321762A3E3F007604A508847BC04E8FB0A9FE36BCA8CA</CreateContentTypeResult></CreateContentTypeResponse>
  </soap:Body>

Assume that the user has already created the column "Cost in Yen" (which has internal name Cost_x0020_in_x0020_Yen) on the "Tokyo Project" list, and that the user wants this field to be included in the content type. The user decides that the more general column "Cost" (which has internal name Cost0) inherited from the parent content type SHOULD be removed. By using the content type identifier from the previous response, the protocol client makes the following request:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <UpdateContentType xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>Tokyo Project</listName>
      <contentTypeId>0x010100D0C022956380194BB5407321762A3E3F007604A508847BC04E8FB0A9FE36BCA8CA</contentTypeId>
      <contentTypeProperties>
        <ContentType Title="Tokyo Travel Expenses"/>
      </contentTypeProperties>
      <newFields>
        <Fields>
          <Method ID="Insert">
            <Field  Name="Cost_x0020_in_x0020_Yen">
            </Field>
          </Method>
        </Fields>
      </newFields>
      <deleteFields>
        <Fields>
          <Method ID="Delete">
            <Field Name="Cost0">
            </Field>
          </Method>
        </Fields>
      </deleteFields>
    </UpdateContentType>
  </soap:Body>
</soap:Envelope>

The protocol client receives the following response from the protocol server:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <UpdateContentTypeResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <UpdateContentTypeResult>
        <Results>
          <Method ID="Delete">
            <ErrorCode>0x00000000</ErrorCode>
          </Method>
          <Method ID="Insert">
            <ErrorCode>0x00000000</ErrorCode>
            <FieldRef ID="{fea344e3-3c7c-44a3-abd0-36dd45a1684a}" Name="Cost_x0020_in_x0020_Yen" Required="FALSE" Hidden="FALSE" Customization="" ReadOnly="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Aggregation="" Node="" />
          </Method>
          <ListProperties ID="0x010100D0C022956380194BB5407321762A3E3F007604A508847BC04E8FB0A9FE36BCA8CA" Name="Tokyo Travel Expenses" Group="Custom Content Types" Description="Document related to travel expenses for the Tokyo Project" Version="6" />
        </Results>
      </UpdateContentTypeResult>
    </UpdateContentTypeResponse>
  </soap:Body>
</soap:Envelope>

Assume that a document library named "Test Document Library" contains a content type with identification 0x0101005B1A76E874B25B49A1D942FE13273862.

A protocol client wants to add some custom information in the XML document to the list content type by using the UpdateContentTypesXmlDocument operation.

A sample request for UpdateContentTypesXmlDocument looks similar to the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <UpdateContentTypesXmlDocument xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>Test Document Library</listName>
      <newDocument>
        <ContentTypes xmlns="">
          <ContentType ID="0x0101005B1A76E874B25B49A1D942FE13273862">
            <customInfo xmlns="http://www.contoso.com/customInfo">Here is some custom information</customInfo>
          </ContentType>
        </ContentTypes>
      </newDocument>
    </UpdateContentTypesXmlDocument>
  </soap:Body>
</soap:Envelope>

A sample response for UpdateContentTypesXmlDocument operation (section 3.1.4.28) looks similar to the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <UpdateContentTypesXmlDocumentResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <UpdateContentTypesXmlDocumentResult>
        <Success/>
      </UpdateContentTypesXmlDocumentResult>
    </UpdateContentTypesXmlDocumentResponse>
  </soap:Body>
</soap:Envelope>

A protocol client wants to add some custom information in the XML document to the list content type. This can be done by calling the UpdateContentTypeXmlDocument operation (section 3.1.4.28).

A sample request for UpdateContentTypeXmlDocument looks similar to the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <UpdateContentTypeXmlDocument xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>Test Document Library</listName>
      <contentTypeId>
0x0101005B1A76E874B25B49A1D942FE13273862</contentTypeId>
      <newDocument>
        <customInfo xmlns="http://www.contoso.com/customInfo">Here is some custom information</customInfo>
      </newDocument>
    </UpdateContentTypeXmlDocument>
  </soap:Body>
</soap:Envelope>

A sample response for UpdateContentTypeXmlDocument looks similar to the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <UpdateContentTypeXmlDocumentResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <UpdateContentTypeXmlDocumentResult>
        <Success/>
      </UpdateContentTypeXmlDocumentResult>
    </UpdateContentTypeXmlDocumentResponse>
  </soap:Body>
</soap:Envelope>

After the custom information is added, the XML document of the list looks similar to the following:

<XmlDocument NamespaceURI="http://www.contoso.com/customInfo">
  <customInfo xmlns="http://www.contoso.com/customInfo">Here is some custom information</customInfo> 
</XmlDocument>

The protocol client can delete the custom information by calling DeleteContentTypeXmlDocument operation (section 3.1.4.12).

A sample request for DeleteContentTypeXmlDocument looks similar to the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <DeleteContentTypeXmlDocument xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <listName>Test Document Library</listName>
      <contentTypeId>
0x0101005B1A76E874B25B49A1D942FE13273862</contentTypeId>
      <documentUri>http://www.contoso.com/customInfo</documentUri>
    </DeleteContentTypeXmlDocument>
  </soap:Body>
</soap:Envelope>

A sample response for DeleteContentTypeXmlDocument looks similar to the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <DeleteContentTypeXmlDocumentResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
      <DeleteContentTypeXmlDocumentResult>
        <Success/>
      </DeleteContentTypeXmlDocumentResult>
    </DeleteContentTypeXmlDocumentResponse>
  </soap:Body>
</soap:Envelope>
Show:
© 2014 Microsoft