4.9 UpdateContentTypeXmlDocument
A protocol client wants to add some custom information in the XML document to a site content type with identifier 0x0101. This can be done by using UpdateContentTypeXmlDocument operation.
The following is a sample request for UpdateContentTypeXmlDocument:
-
<?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/"> <contentTypeId>0x0101</contentTypeId> <newDocument> <customInfo xmlns="http://www.contoso.com/customInfo">Here is some custom information</customInfo> </newDocument> </UpdateContentTypeXmlDocument> </soap:Body> </soap:Envelope>
The following is a sample response for UpdateContentTypeXmlDocument:
-
<?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 site content type is specified as follows:
-
<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 using RemoveContentTypeXmlDocument operation.
A sample request for RemoveContentTypeXmlDocument is shown in the following code:
-
<?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> <RemoveContentTypeXmlDocument xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <contentTypeId>0x0101</contentTypeId> <documentUri>http://www.contoso.com/customInfo</documentUri> </RemoveContentTypeXmlDocument> </soap:Body> </soap:Envelope>
The following is a sample response to RemoveContentTypeXmlDocument:
-
<?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> <RemoveContentTypeXmlDocumentResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <RemoveContentTypeXmlDocumentResult> <Success/> </RemoveContentTypeXmlDocumentResult> </RemoveContentTypeXmlDocumentResponse> </soap:Body> </soap:Envelope>