3.1.4.9 CreateContentType

The CreateContentType operation<45> is used to create a new content type on a list.

 <wsdl:operation name="CreateContentType">
     <wsdl:input message="CreateContentTypeSoapIn" />
     <wsdl:output message="CreateContentTypeSoapOut" />
 </wsdl:operation>

The protocol client sends a CreateContentTypeSoapIn request message (section 3.1.4.9.1.1) and the protocol server responds with a CreateContentTypeSoapOut response message (section 3.1.4.9.1.2), as follows:

  1. If the specified listName is a valid GUID and corresponds to the identification of a list on the site, use that list.

  2. If the specified listName is not a valid GUID or does not correspond to the identification of a list on the site, check if the listName corresponds to the list title of a list on the site and if so, use that list.

  3. If the specified listName does not correspond to a list from either of these checks, the protocol server SHOULD<46> return a SOAP fault with error code 0x82000006. This indicates that the listName specified does not exist or it could have been deleted by another user.

  4. If the parentType is not a valid content type identifier or is not the content type identifier of a content type available on the list, the protocol server MUST return a SOAP fault. There is no error code for this fault.

  5. The protocol server attempts to create a new content type on the list with the given parent content type and display name. If an error specified in section 3.1.4.9.2.1 is encountered during this operation, the protocol server MUST return a SOAP fault.

  6. The protocol server adds the given fields to the newly created content type. If an error regarding the fields is encountered during this operation, the protocol server MUST ignore this error. The content type will still exist as a newly created content type on the protocol server and all fields added to the content type before the error was encountered MUST stay added to the content type.

  7. The protocol server updates the content type with the given properties. If an error regarding the naming of properties, similar to the error specified in section 3.1.4.9.2.1, is encountered during this operation, the protocol server MUST return a SOAP fault. The content type will still exist as a newly created content type on the protocol server. All fields that were added MUST stay added to the content type, and all properties updated before the error was encountered MUST stay updated.