none
Setting PR_CONVERSATION_INDEX

    Question

  • Hi all,

    I'm trying to do a seemingly simple task of setting the PR_CONVERSATION_INDEX  (PidTagConversationIndex) on my item before I send my email out. However, due to my environment and other issues, this is becoming a pretty tough task. Our application is written in completely in Java and we use the Apache Jakarta Slide library to make WebDav requests and essentially, that's how we communicate with exchange. Now Jakarta Slide has a very restrictive method signature for the proppatch method such that it requires that the value of the MAPI property you're setting must be a string. This works OK for MAPI properties like PR_COVERSATION_TOPIC but for PR_CONVERSATION_INDEX this doesn't quite fly since that property is of type PT_BINARY. Can anyone help out and let me know of a way to tackle this issue?

    One alternative that I was considering was to use Exchange Web Services (EWS). Does anyone know if the same end can be achieved by using EWS? And if so, how should I go about it?

    All responses will be greatly appreciated.

    Thanks,

    Nitin
    Wednesday, April 15, 2009 3:50 AM

Answers

  • Hello Nitin27,

    You can set the PR_CONVERSATION_INDEX property by using EWS. Here is the SOAP request you would use to set the PR_CONVERSATION_INDEX property on a new email message that is saved in the Drafts folder:
    <?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">
    	<soap:Header>
    		<t:RequestServerVersion Version="Exchange2007_SP1"/>
    	</soap:Header>
    	<soap:Body>
    		<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" MessageDisposition="SaveOnly">
    			<SavedItemFolderId>
    				<t:DistinguishedFolderId Id="drafts"/>
    			</SavedItemFolderId>
    			<Items>
    				<t:Message>
    					<t:Subject>Test subject</t:Subject>
    					<t:ExtendedProperty>
    						<t:ExtendedFieldURI PropertyTag="0x0071" PropertyType="Binary"/>
    						<t:Value>Acm5V5HS1wR4VjynTOGlZ1PCflvzEwAAu6WQAKmSqCAAACNbIAAcp9oAAGCSvzA=</t:Value>
    					</t:ExtendedProperty>
    				</t:Message>
    			</Items>
    		</CreateItem>
    	</soap:Body>
    </soap:Envelope>



    Michael | Microsoft Exchange SDK
    Wednesday, April 15, 2009 7:57 PM

All replies

  • Hi all,

    I'm trying to do a seemingly simple task of setting the PR_CONVERSATION_INDEX  (PidTagConversationIndex) on my item before I send my email out. However, due to my environment and other issues, this is becoming a pretty tough task. Our application is written in completely in Java and we use the Apache Jakarta Slide library to make WebDav requests and essentially, that's how we communicate with exchange. Now Jakarta Slide has a very restrictive method signature for the proppatch method such that it requires that the value of the MAPI property you're setting must be a string. This works OK for MAPI properties like PR_COVERSATION_TOPIC but for PR_CONVERSATION_INDEX this doesn't quite fly since that property is of type PT_BINARY. Can anyone help out and let me know of a way to tackle this issue?

    One alternative that I was considering was to use Exchange Web Services (EWS). Does anyone know if the same end can be achieved by using EWS? And if so, how should I go about it?

    All responses will be greatly appreciated.

    Thanks,

    Nitin
    Wednesday, April 15, 2009 5:59 PM
  • Hello Nitin27,

    You can set the PR_CONVERSATION_INDEX property by using EWS. Here is the SOAP request you would use to set the PR_CONVERSATION_INDEX property on a new email message that is saved in the Drafts folder:
    <?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">
    	<soap:Header>
    		<t:RequestServerVersion Version="Exchange2007_SP1"/>
    	</soap:Header>
    	<soap:Body>
    		<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" MessageDisposition="SaveOnly">
    			<SavedItemFolderId>
    				<t:DistinguishedFolderId Id="drafts"/>
    			</SavedItemFolderId>
    			<Items>
    				<t:Message>
    					<t:Subject>Test subject</t:Subject>
    					<t:ExtendedProperty>
    						<t:ExtendedFieldURI PropertyTag="0x0071" PropertyType="Binary"/>
    						<t:Value>Acm5V5HS1wR4VjynTOGlZ1PCflvzEwAAu6WQAKmSqCAAACNbIAAcp9oAAGCSvzA=</t:Value>
    					</t:ExtendedProperty>
    				</t:Message>
    			</Items>
    		</CreateItem>
    	</soap:Body>
    </soap:Envelope>



    Michael | Microsoft Exchange SDK
    Wednesday, April 15, 2009 7:57 PM
  • Hi Nitin,

    As Michael suggests, it is possible to set the PR_CONVERSATION_INDEX property and the PR_CONVERSATION_TOPIC property by using extended properties in EWS. Michael shows in the XML snippet he posted how to set the PR_CONVERSATION_INDEX property using the CreateItem request and setting the corresponding extended property (propertyTag=0x0071). Here is an example of an XML request that sets the PR_CONVERSATION_TOPIC property (on a new email message that is saved in the Drafts folder) by using the corresponding extended property (propertyTag=0x0070).

    Does this provide the guidance you're looking for?

    <?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">
    	<soap:Header>
    		<t:RequestServerVersion Version="Exchange2007_SP1"/>
    	</soap:Header>
    	<soap:Body>
    		<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" MessageDisposition="SaveOnly">
    			<SavedItemFolderId>
    				<t:DistinguishedFolderId Id="drafts"/>
    			</SavedItemFolderId>
    			<Items>
    				<t:Message>
    					<t:Subject>Test subject</t:Subject>
    					<t:ExtendedProperty>
    						<t:ExtendedFieldURI PropertyTag="0x0070" PropertyType="String"/>
    						<t:Value>Message Topic</t:Value>
    					</t:ExtendedProperty>
    				</t:Message>
    			</Items>
    		</CreateItem>
    	</soap:Body>
    </soap:Envelope>
    

    Thanks,
    Kim Brandl

    Programming Writer, Microsoft Exchange Developer Documentation Team
    Saturday, April 18, 2009 12:06 AM