3.1.4.1 CreateContentType

This operation<9> creates a new content type on the context site. This operation is defined as follows:

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

The protocol client sends a CreateContentTypeSoapIn request message, and the protocol server responds with a CreateContentTypeSoapOut response message, as follows:

  1. If the parentType is not a valid content type identifier or is not the content type identifier of a content type that is available on the context site, a SOAP fault MUST be returned.

  2. The protocol server creates a new content type on the context site with the specified parent content type and display name.

  3. The protocol server adds the specified fields to the newly created content type.

  4. The protocol server updates the content type with the specified properties.

The protocol server MUST return a SOAP fault if a problem is encountered in any of these steps. If the protocol server has finished some of the steps in the CreateContentType operation prior to encountering an error, the protocol server is not required to undo the finished actions. Consequently, if the protocol server returns a SOAP fault in response to the protocol client request, this does not mean that the protocol server has not created a new content type.

When the protocol server returns a SOAP fault, use GetContentType to determine whether the content type was successfully created.