# Table of contents:
# Introduction
CreateDocument is one of the SOAP actions the Schematized Storage Service provides.
Create a document.
# Client/Request
The template used in this action is described on the Schematized Storage Service main page.
# CreateDocumentThis element has only one attribute:
xmlns: Is always set tohttp://www.msn.com/webservices/storage/, followed by the version of the schema.
This element has three children:
<parentHandle>: Described below.<document>: Described below.<relationshipName>: The friendly name of the document's relationship:Messenger User TileMessenger Signature Sound
# document
This element has only one attribute:
xsi:type: The type of this<document>:PhotoBinary
This element has two children:
<Name>: The friendly name of the document.<DocumentStreams>: Described below.
This element contains one or more <DocumentStream> elements.
This element has only one attribute:
xsi:type: The type of this<DocumentStream>:PhotoStreamBinary
This element has four children:
<DocumentStreamType>: The sub-type of this<DocumentStream>:UserTileStaticUserTileDynamicBinary
<MimeType>: The MIME type of the document:image/png(Note: Not always an actual PNG.)application/vnd.ms-cab-compressedaudio/x-ms-wmapng(Not a MIME type, just used by some clients)cab(Not a MIME type, just used by some clients)
<Data>: Base64-encoded data.<DataSize>: This is always0.
# Server/Response
The template used in this action is described on the Schematized Storage Service main page.
# CreateDocumentResponseThis element has only one attribute:
xmlns: Is always set tohttp://www.msn.com/webservices/storage/, followed by the version of the schema.
This element has only one child:
<CreateDocumentResult>: The resource ID of the created document.
# Examples
# Schema version w10
# Photo document with static image only
# Client/Request
POST /storageservice/SchematizedStore.asmx HTTP/1.1
SOAPAction: http://www.msn.com/webservices/storage/w10/CreateDocument
Cache-Control: no-cache
Content-Type: text/xml; charset=utf-8
Content-Length: 1427
<?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"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>
<soap:Header>
<StorageApplicationHeader xmlns="http://www.msn.com/webservices/storage/w10">
<ApplicationID>Messenger Client 8.5</ApplicationID>
<Scenario>RoamingIdentityChanged</Scenario>
</StorageApplicationHeader>
<StorageUserHeader xmlns="http://www.msn.com/webservices/storage/w10">
<Puid>0</Puid>
<TicketToken>t=ticket&p=profile</TicketToken>
</StorageUserHeader>
</soap:Header>
<soap:Body>
<CreateDocument xmlns="http://www.msn.com/webservices/storage/w10">
<parentHandle>
<RelationshipName>/UserTiles</RelationshipName>
<Alias>
<Name>4294967298</Name>
<NameSpace>MyCidStuff</NameSpace>
</Alias>
</parentHandle>
<document xsi:type="Photo">
<Name>Example Static Image</Name>
<DocumentStreams>
<DocumentStream xsi:type="PhotoStream">
<DocumentStreamType>UserTileStatic</DocumentStreamType>
<MimeType>image/png</MimeType>
<Data>[[removed intentionally]]</Data>
<DataSize>0</DataSize>
</DocumentStream>
</DocumentStreams>
</document>
<relationshipName>Messenger User Tile</relationshipName>
</CreateDocument>
</soap:Body>
</soap:Envelope>
# Server/Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 845
<?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:Header>
<AffinityCacheHeader xmlns="http://www.msn.com/webservices/storage/w10">
<CacheKey>MjAyNi0wMi0wOFQxMDoxODozNi43MDVa</CacheKey>
</AffinityCacheHeader>
<StorageUserHeader xmlns="http://www.msn.com/webservices/storage/w10">
<Puid>0</Puid>
<Cid>4294967298</Cid>
<TicketToken>t=ticket&p=profile</TicketToken>
<IsAdmin>false</IsAdmin>
</StorageUserHeader>
</soap:Header>
<soap:Body>
<CreateDocumentResponse xmlns="http://www.msn.com/webservices/storage/w10">
<CreateDocumentResult>cid_4294967298!documents!1</CreateDocumentResult>
</CreateDocumentResponse>
</soap:Body>
</soap:Envelope>
# Photo document with both static and dynamic images
# Client/Request
POST /storageservice/SchematizedStore.asmx HTTP/1.1
SOAPAction: http://www.msn.com/webservices/storage/w10/CreateDocument
Cache-Control: no-cache
Content-Type: text/xml; charset=utf-8
Content-Length: 1693
<?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"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>
<soap:Header>
<StorageApplicationHeader xmlns="http://www.msn.com/webservices/storage/w10">
<ApplicationID>Messenger Client 8.5</ApplicationID>
<Scenario>RoamingIdentityChanged</Scenario>
</StorageApplicationHeader>
<StorageUserHeader xmlns="http://www.msn.com/webservices/storage/w10">
<Puid>0</Puid>
<TicketToken>t=ticket&p=profile</TicketToken>
</StorageUserHeader>
</soap:Header>
<soap:Body>
<CreateDocument xmlns="http://www.msn.com/webservices/storage/w10">
<parentHandle>
<RelationshipName>/UserTiles</RelationshipName>
<Alias>
<Name>4294967298</Name>
<NameSpace>MyCidStuff</NameSpace>
</Alias>
</parentHandle>
<document xsi:type="Photo">
<Name>Example Dynamic Image</Name>
<DocumentStreams>
<DocumentStream xsi:type="PhotoStream">
<DocumentStreamType>UserTileStatic</DocumentStreamType>
<MimeType>image/png</MimeType>
<Data>[[removed intentionally]]</Data>
<DataSize>0</DataSize>
</DocumentStream>
<DocumentStream xsi:type="PhotoStream">
<DocumentStreamType>UserTileDynamic</DocumentStreamType>
<MimeType>application/vnd.ms-cab-compressed</MimeType>
<Data>[[removed intentionally]]</Data>
<DataSize>0</DataSize>
</DocumentStream>
</DocumentStreams>
</document>
<relationshipName>Messenger User Tile</relationshipName>
</CreateDocument>
</soap:Body>
</soap:Envelope>
# Server/Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 845
<?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:Header>
<AffinityCacheHeader xmlns="http://www.msn.com/webservices/storage/w10">
<CacheKey>MjAyNi0wMi0wOFQxMDoxODozNi43MDVa</CacheKey>
</AffinityCacheHeader>
<StorageUserHeader xmlns="http://www.msn.com/webservices/storage/w10">
<Puid>0</Puid>
<Cid>4294967298</Cid>
<TicketToken>t=ticket&p=profile</TicketToken>
<IsAdmin>false</IsAdmin>
</StorageUserHeader>
</soap:Header>
<soap:Body>
<CreateDocumentResponse xmlns="http://www.msn.com/webservices/storage/w10">
<CreateDocumentResult>cid_4294967298!documents!1</CreateDocumentResult>
</CreateDocumentResponse>
</soap:Body>
</soap:Envelope>
# Binary document with Signature Sound
# Client/Request
POST /storageservice/SchematizedStore.asmx HTTP/1.1
SOAPAction: http://www.msn.com/webservices/storage/w10/CreateDocument
Cache-Control: no-cache
Content-Type: text/xml; charset=utf-8
Content-Length: 1433
<?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"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>
<soap:Header>
<StorageApplicationHeader xmlns="http://www.msn.com/webservices/storage/w10">
<ApplicationID>Messenger Client 9.0</ApplicationID>
<Scenario>RoamingIdentityChanged</Scenario>
</StorageApplicationHeader>
<StorageUserHeader xmlns="http://www.msn.com/webservices/storage/w10">
<Puid>0</Puid>
<TicketToken>t=ticket&p=profile</TicketToken>
</StorageUserHeader>
</soap:Header>
<soap:Body>
<CreateDocument xmlns="http://www.msn.com/webservices/storage/w10">
<parentHandle>
<RelationshipName>SignatureSound</RelationshipName>
<Alias>
<Name>4294967298</Name>
<NameSpace>MyCidStuff</NameSpace>
</Alias>
</parentHandle>
<document xsi:type="Binary">
<Name>Example Signature Sound</Name>
<DocumentStreams>
<DocumentStream xsi:type="Binary">
<DocumentStreamType>Binary</DocumentStreamType>
<MimeType>audio/x-ms-wma</MimeType>
<Data>[[removed intentionally]]</Data>
<DataSize>0</DataSize>
</DocumentStream>
</DocumentStreams>
</document>
<relationshipName>Messenger Signature Sound</relationshipName>
</CreateDocument>
</soap:Body>
</soap:Envelope>
# Server/Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 845
<?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:Header>
<AffinityCacheHeader xmlns="http://www.msn.com/webservices/storage/w10">
<CacheKey>MjAyNi0wMi0wOFQxMDoxODozNi43MDVa</CacheKey>
</AffinityCacheHeader>
<StorageUserHeader xmlns="http://www.msn.com/webservices/storage/w10">
<Puid>0</Puid>
<Cid>4294967298</Cid>
<TicketToken>t=ticket&p=profile</TicketToken>
<IsAdmin>false</IsAdmin>
</StorageUserHeader>
</soap:Header>
<soap:Body>
<CreateDocumentResponse xmlns="http://www.msn.com/webservices/storage/w10">
<CreateDocumentResult>cid_4294967298!documents!2</CreateDocumentResult>
</CreateDocumentResponse>
</soap:Body>
</soap:Envelope>