none
Failing to set extended properties via EWS RRS feed

  • Question

  • -----MAPI property of the MSG----
    Type: PT_LONG
    DASL: http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/812A0003
    Named Prop Name: id: 0x812A=33066 = PidLidTaskAcceptanceState, dispidTaskDelegValue
    Named Prop Guid: {00062003-0000-0000-C000-000000000046} = PSETID_Task
    Value: 0

    -----code----
    new EmailMessage(...);
    ...
    ExtendedPropertyDefinition def = new ExtendedPropertyDefinition(new Guid("00062003-0000-0000-c000-000000000046"), 0x0000812A, MapiPropertyType.Integer);
    msg.SetExtendedProperty(def, 0);
    ...
    msg.Save(...);

    Microsoft.Exchange.WebServices.dll version 14.2.51.0

    -----error----
          <m:CreateAttachmentResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:ResponseMessages>
              <m:CreateAttachmentResponseMessage ResponseClass="Error">
                <m:MessageText>The extended property value is inconsistent with its type.</m:MessageText>
                <m:ResponseCode>ErrorInvalidExtendedPropertyValue</m:ResponseCode>
                <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
                <m:MessageXml>
                  <t:ExtendedFieldURI DistinguishedPropertySetId="Task" PropertyId="33066" PropertyType="Integer" />
                </m:MessageXml>
                <m:Attachments />
              </m:CreateAttachmentResponseMessage>
            </m:ResponseMessages>
          </m:CreateAttachmentResponse>

    ----observation----
    Strangely enough, another similar property is successfully set, for example 0x00008129.
    The same property is easily edited via MAPI.
    Thursday, May 31, 2012 8:01 AM

All replies

  • -----MAPI property of the MSG----
    Type: PT_STRING8
    DASL: http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8581001E
    Named Prop Name: id: 0x8581=34177 = PidLidInternetAccountStamp, dispidInetAcctStamp
    Named Prop Guid: {00062008-0000-0000-C000-000000000046} = PSETID_Common
    Value: 00000002EXCH2010/o=First Organization/ou=Exchange Administrative Group (sanitized)/cn=Recipients/cn=sanitized

    -----error----
          2012-05-31 00:13:21,169 [ProcessorThread] ERROR <sanitized>.Ews.Api - Message saving failed. The invalid value '00000002EXCH2010/o=First Organization/ou=Exchange Administrative Group (sanitized)/cn=Recipients/cn=sanitized' was specified for the 'Value' element.
    Microsoft.Exchange.WebServices.Data.ServiceXmlSerializationException: The invalid value '00000002EXCH2010/o=First Organization/ou=Exchange Administrative Group (sanitized)/cn=Recipients/cn=sanitized' was specified for the 'Value' element. ---> System.ArgumentException: '', hexadecimal value 0x01, is an invalid character.
       at System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(Int32 ch, Byte* pDst, Boolean entitize)
       at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
       at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
       at System.Xml.XmlUtf8RawTextWriterIndent.WriteString(String text)
       at System.Xml.XmlRawWriter.WriteValue(String value)
       at System.Xml.XmlWellFormedWriter.WriteValue(String value)
       at Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter.WriteValue(String value, String name)
       --- End of inner exception stack trace ---
       at Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter.WriteValue(String value, String name)
       at Microsoft.Exchange.WebServices.Data.EwsServiceXmlWriter.WriteElementValue(XmlNamespace xmlNamespace, String localName, String displayName, Object value)
       at Microsoft.Exchange.WebServices.Data.ExtendedProperty.WriteElementsToXml(EwsServiceXmlWriter writer)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.WriteToXml(EwsServiceXmlWriter writer, XmlNamespace xmlNamespace, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.WriteToXml(EwsServiceXmlWriter writer, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ExtendedPropertyCollection.WriteToXml(EwsServiceXmlWriter writer, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.WritePropertyValueToXml(EwsServiceXmlWriter writer, PropertyBag propertyBag, Boolean isUpdateOperation)
       at Microsoft.Exchange.WebServices.Data.PropertyBag.WriteToXml(EwsServiceXmlWriter writer)
       at Microsoft.Exchange.WebServices.Data.ItemAttachment.WriteElementsToXml(EwsServiceXmlWriter writer)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.WriteToXml(EwsServiceXmlWriter writer, XmlNamespace xmlNamespace, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.WriteToXml(EwsServiceXmlWriter writer, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.CreateAttachmentRequest.WriteElementsToXml(EwsServiceXmlWriter writer)
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.WriteBodyToXml(EwsServiceXmlWriter writer)
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.WriteToXml(EwsServiceXmlWriter writer)
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.BuildEwsHttpWebRequest()
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(HttpWebRequest& request)
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
       at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateAttachments(String parentItemId, IEnumerable`1 attachments)
       at Microsoft.Exchange.WebServices.Data.AttachmentCollection.InternalCreateAttachments(String parentItemId, IEnumerable`1 attachments)
       at Microsoft.Exchange.WebServices.Data.AttachmentCollection.Save()
       at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
       at Microsoft.Exchange.WebServices.Data.Item.Save(FolderId parentFolderId)
       at <sanitized>.Ews.Api.EwsMessage.Save(String folderId)
       
    ----observation----
    A property value containing 0x01 character is failing to be set.
    The same property is easily edited via MAPI.
    Thursday, May 31, 2012 8:01 AM
  • Hi,

    From the error XML it appears you are setting extended properties for CreateAttachement. PidLidTaskAcceptanceState property indicates the acceptance state of the task. Could you please share the piece of code for better understanding.

    Regards,
    Pallav

    Thursday, June 7, 2012 11:35 AM
  • Thanks Pallav,

    The code is posted above:

    -----code----
    new EmailMessage(...);
    ...
    ExtendedPropertyDefinition def = new ExtendedPropertyDefinition(new Guid("00062003-0000-0000-c000-000000000046"), 0x0000812A, MapiPropertyType.Integer);
    msg.SetExtendedProperty(def, 0);
    ...
    msg.Save(...);

    Microsoft.Exchange.WebServices.dll version 14.2.51.0

    -----end code----

    This is the only code relevant to the issue. Please let me know if you need more info.

    Friday, June 8, 2012 8:44 AM
  • Hi,

    I have found that recommendation is to use 0x8113(PidLidTaskState[MS-OXOTASK]) instead of 0x812A(PidLidTaskAcceptanceState[MS-OXOTASK]).
    Please have a look at the Remark section of the article below.
    http://msdn.microsoft.com/en-us/library/exchangewebservices.taskdelegatestatetype(v=exchg.140).aspx

    Regards,
    -Pallav


    Tuesday, June 12, 2012 4:02 PM
  • Are these properties interchangeable?

    Or is PidLidTaskAcceptanceState not supported anymore?

    We are specifically targeting PidLidTaskAcceptanceState property. Setting a different property instead is not accurate from our perspective. We want to map MAPI and EWS messages one to one and choosing a different property for EWS is not a solution.

    Wednesday, June 13, 2012 7:44 AM
  • I would suggest you to read "Delegation State" in "Inside Microsoft® Exchange Server 2007 Web Services" book. This issue is addressed in the book and also there is a code sample. http://www.microsoft.com/mspress/companion/9780735623927/

    regards,
    Pallav

    If my answer resolves your query, please mark it as answer.

    Friday, June 15, 2012 8:44 AM
  • This doesn't really resolve the issue, because we can not set the PidLidTaskAcceptanceState property, which is the ultimate goal. But the links you provided made it clear, that there is no available solution for it yet.

    Can you please also advise on PidLidInternetAccountStamp property issue?

    Friday, June 15, 2012 12:34 PM
  • Any update for my questions?
    Wednesday, July 4, 2012 4:07 PM
  • PidLidBusyStatusis also failing with a similar reason "The extended property value is inconsistent with its type."

    Is there a property we can use instead?

    Wednesday, October 3, 2012 1:28 PM