Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Der CreateItem-Vorgang wird verwendet, um Kontakte im Exchange-Speicher zu erstellen.
Hinweise
Die Erstellung privater Verteilerlisten wird nicht unterstützt. Alle Eigenschaften innerhalb des CompleteName-Containers sind schreibgeschützt und können nicht für ein Kontaktelement festgelegt werden.
CreateItem-Anforderungsbeispiel
Beschreibung
Das folgende Beispiel einer gültigen CreateItem-SOAP-Anforderung zeigt, wie sie einen Kontakt im Standardordner Kontakte erstellen.
Code
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" >
<SavedItemFolderId>
<t:DistinguishedFolderId Id="contacts"/>
</SavedItemFolderId>
<Items>
<t:Contact>
<t:FileAs>SampleContact</t:FileAs>
<t:GivenName>Tanja</t:GivenName>
<t:CompanyName>Blue Yonder Airlines</t:CompanyName>
<t:EmailAddresses>
<t:Entry Key="EmailAddress1">tplate@example.com</t:Entry>
</t:EmailAddresses>
<t:PhysicalAddresses>
<t:Entry Key="Business">
<t:Street>1234 56th Ave</t:Street>
<t:City>La Habra</t:City>
<t:State>CA</t:State>
<t:CountryOrRegion>USA</t:CountryOrRegion>
</t:Entry>
</t:PhysicalAddresses>
<t:PhoneNumbers>
<t:Entry Key="BusinessPhone">4255550199</t:Entry>
</t:PhoneNumbers>
<t:JobTitle>Manager</t:JobTitle>
<t:Surname>Plate</t:Surname>
</t:Contact>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>
Anfordern von Elementen
In der Antwort werden folgende Elemente verwendet:
Erfolgreiche CreateItem-Anforderung
Beschreibung
Das folgende Beispiel zeigt eine erfolgreiche Antwort auf die CreateItem-Anforderung, die einen Kontakt erstellt hat. In diesem Beispiel enthält die Antwort den Bezeichner des neu erstellten Elements.
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:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="602" MinorBuildNumber="0"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:CreateItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Contact>
<t:ItemId Id="AAAtA=" ChangeKey="EQAAAB" />
</t:Contact>
</m:Items>
</m:CreateItemResponseMessage>
</m:ResponseMessages>
</CreateItemResponse>
</soap:Body>
</soap:Envelope>
Kommentare
Der Elementbezeichner wurde gekürzt, um die Lesbarkeit zu erhalten.
Erfolgreiche Antwortelemente
In der Antwort werden folgende Elemente verwendet:
Beispiel für ungültige CreateItem-Anforderung
Beschreibung
Das folgende Beispiel zeigt eine Anforderung, die gültige XML-Daten enthält, aber inkompatible Anweisungen. Ein Kontakt kann nicht in einem Suchordner erstellt werden.
Code
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<CreateItem xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'>
<SavedItemFolderId>
<t:DistinguishedFolderId Id='searchfolders'/>
</SavedItemFolderId>
<Items>
<t:Contact>
<t:ItemClass>IPM.Contact</t:ItemClass>
</t:Contact>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>
CreateItem -Fehlerantwort (Contact)
Beschreibung
Das folgende Beispiel zeigt eine Fehlerantwort auf eine CreateItem (Contact)-Anforderung.
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:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="602" MinorBuildNumber="0"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:CreateItemResponseMessage ResponseClass="Error">
<m:MessageText>Cannot create a contact in a non-contact Folder.</m:MessageText>
<m:ResponseCode>ErrorCannotCreateContactInNonContactFolder</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Items />
</m:CreateItemResponseMessage>
</m:ResponseMessages>
</CreateItemResponse>
</soap:Body>
</soap:Envelope>
Fehlerantwortelemente
Folgende Elemente werden in der Fehlerantwort verwendet: