Operação FindConversation
A operação FindConversation enumera uma lista de conversas em uma pasta.
Exemplo de solicitação FindConversation
Descrição
O exemplo a seguir de uma solicitação FindConversation mostra como formar uma solicitação para localizar a primeira conversa na pasta Caixa de Entrada.
Código
<?xml version="1.0" encoding="utf-8" ?>
<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"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP1" />
</soap:Header>
<soap:Body>
<m:FindConversation>
<m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="1" Offset="0"/>
<m:ParentFolderId>
<t:DistinguishedFolderId Id ="inbox"/>
</m:ParentFolderId>
</m:FindConversation>
</soap:Body>
</soap:Envelope>
Elementos de solicitação
Os seguintes elementos são usados na solicitação:
Exemplo de resposta do FindConversation bem-sucedido
Descrição
O exemplo a seguir mostra uma resposta bem-sucedida a uma solicitação FindConversation .
Código
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="14"
MinorVersion="1"
MajorBuildNumber="91"
MinorBuildNumber="0"
Version="Exchange2010_SP1"
xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<FindConversationResponse ResponseClass="Success"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<Conversations>
<t:Conversation xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:ConversationId Id="AAQkADRlZDhjZDVlLzYtNDcyZi1i32hHpdc="/>
<t:ConversationTopic>Have you heard about EWS?</t:ConversationTopic>
<t:UniqueRecipients>
<t:String>User1First User1Last</t:String>
</t:UniqueRecipients>
<t:GlobalUniqueRecipients>
<t:String>User2First User2Last</t:String>
<t:String>User1First User1Last</t:String>
</t:GlobalUniqueRecipients>
<t:UniqueSenders>
<t:String>User2First User2Last</t:String>
</t:UniqueSenders>
<t:GlobalUniqueSenders>
<t:String>User1First User1Last</t:String>
<t:String>User2First User2Last</t:String>
</t:GlobalUniqueSenders>
<t:LastDeliveryTime>2010-02-09T02:20:49Z</t:LastDeliveryTime>
<t:GlobalLastDeliveryTime>2010-02-09T02:21:01Z</t:GlobalLastDeliveryTime>
<t:HasAttachments>false</t:HasAttachments>
<t:GlobalHasAttachments>false</t:GlobalHasAttachments>
<t:MessageCount>2</t:MessageCount>
<t:GlobalMessageCount>5</t:GlobalMessageCount>
<t:UnreadCount>0</t:UnreadCount>
<t:Size>6474</t:Size>
<t:GlobalSize>14497</t:GlobalSize>
<t:ItemClasses>
<t:ItemClass>IPM.Note</t:ItemClass>
</t:ItemClasses>
<t:GlobalItemClasses>
<t:ItemClass>IPM.Note</t:ItemClass>
</t:GlobalItemClasses>
<t:Importance>Normal</t:Importance>
<t:GlobalImportance>Normal</t:GlobalImportance>
<t:ItemIds>
<t:ItemId Id="AAMkADRlZDhjZDVlLTU3qaTQvcFtnmUZQY2FuFP93qPtAAAADXWyAAA=" ChangeKey="CQAAAA=="/>
<t:ItemId Id="AAMkADRlZDhjZDVFtnmUZQY2vcFtnmUZQY2FuFP93qPtAAAADXWxAAA=" ChangeKey="CQAAAA=="/>
</t:ItemIds>
<t:GlobalItemIds>
<t:ItemId Id="AAMkADRlZDhCQvcFtnmADU5PAACQvcFtnmUZQsdfFPPtAAAADad4AAA=" ChangeKey="CQAAAA=="/>
<t:ItemId Id="AAqaTXQvcFtnmUZQAADU5NAACQvcFmUZQY2FuFP93qPtAAAADXWyAAA=" ChangeKey="CQAAAA=="/>
<t:ItemId Id="AAMkFtnmUZQY2FuFP93qPtAAAADU5vcFtY2FuFP93qPtAAAADad3AAA=" ChangeKey="CQAAAA=="/>
<t:ItemId Id="AAMkLTU3YzQvcFtnmUZQY2FuFP93qPtnmU2FuFP93qPtAAAADXWxAAA=" ChangeKey="CQAAAA=="/>
<t:ItemId Id="AAMkADlLTU3YzYtNDAAAAAB1aGnYmUZQY2FPAmUZQY2FuqPtAAd2AAA=" ChangeKey="CQAAAA=="/>
</t:GlobalItemIds>
</t:Conversation>
</Conversations>
</FindConversationResponse>
</s:Body>
</s:Envelope>
Comentário
O item e os identificadores de conversa no exemplo foram encurtados para preservar a legibilidade.
Elementos de resposta bem-sucedidos
Os seguintes elementos são usados na resposta:
Exemplo de resposta ao erro FindConversation
Descrição
O exemplo a seguir mostra uma resposta de erro à solicitação FindConversation causada por um erro de validação de esquema.
Código
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation</faultcode>
<faultstring xml:lang="en-US">The request failed schema validation: The 'Id' attribute is invalid - The value 'inbox1' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:DistinguishedFolderIdNameType' - The Enumeration constraint failed.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.</e:Message>
<t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:LineNumber>14</t:LineNumber>
<t:LinePosition>34</t:LinePosition>
<t:Violation>The 'Id' attribute is invalid - The value 'inbox1' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:DistinguishedFolderIdNameType' - The Enumeration constraint failed.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Elementos de resposta de erro
Os seguintes elementos são usados na resposta de erro:
Faultcode
Faultstring
Detalhe
Mensagem
Linenumber
Lineposition
Violação