3.1.4.9.2.1 CreateContentType

The CreateContentType element specifies details for the request to create a content type on the list.

 <s:element name="CreateContentType">
   <s:complexType>
       <s:sequence>
         <s:element minOccurs="0" maxOccurs="1" name="listName" type="s:string" />
         <s:element minOccurs="0" maxOccurs="1" name="displayName" type="s:string" />
         <s:element minOccurs="0" maxOccurs="1" name="parentType" type="s:string" />
         <s:element name="fields" type="tns:AddOrUpdateFieldsDefinition" 
                    minOccurs="0"/>
         <s:element minOccurs="0" maxOccurs="1" name="contentTypeProperties">
         <s:complexType mixed="true">
           <s:sequence>
             <s:element name="ContentType" type="tns:ContentTypePropertyDefinition" 
                        minOccurs="0" />
           </s:sequence>
         </s:complexType>
         </s:element>
         <s:element name="addToView" type="core:TRUE_Case_Sensitive_Else_Anything" 
                    minOccurs="0"/>
       </s:sequence>
   </s:complexType></s:element>
  

listName: The GUID , or the list title, of the list.

displayName: The XML-encoded name of the content type to be created. A SOAP fault with error code 0x000000b7 MUST be returned if it equals the name of an existing content type on the list, ignoring case. A SOAP fault with error code 0x80131600 MUST be returned, if any of the following conditions applies to the un-encoded version of this element:

  • It is longer than 128 characters.

  • It ends with a period, or begins or ends with a whitespace.

  • It contains a tab, two consecutive periods, or any of the following characters: \/: * ? " # % < > { } | ~ &

parentType: The identification of a content type from which the content type to be created will inherit.

fields: The container for a list of existing fields to be included in the content type, as defined in [MS-WSSTS] section 2.6.

contentTypeProperties: The container for properties to set on the content type, as defined in [MS-WSSTS] section 2.6. This element MUST NOT contain only whitespace.

addToView: Specifies whether the fields will be added to the default list view; where "TRUE" MUST correspond to true, and all other values to false.