0

We call the microsoft exchange to set the extended property which in our case is an unique guid

microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: An internal server error occurred. The operation failed., Invalid named property

Its been working great until now when some of our users are facing the above issue ....

 val uId = getUniqueId();    

val emailExtendedPropDef = new ExtendedPropertyDefinition(uId,"uniqueId", MapiPropertyType.String)
    try {
      email.setExtendedProperty(emailExtendedPropDef, uId.toString)
      email.sendAndSaveCopy()
    } catch {
      case e: Exception =>
        error(s"Exception in setting extended property for user $from", e)
        throw e
    }

trying to find the root cause of the issue, we are also thinking it might be related to throttling on Microsoft exchange for extended properties (Not sure how to prove if it's indeed throttling) any help to point us in the right direction will be of great help

Our use case is to able to retrieve the email when customer want's to reply back we want to retrieve that particular email to be included in users reply....currently we are using the uid to achieve that ....

we have been using the code as per the documentation here

https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633654(v%3Dexchg.80)

and also the documentation here

https://github.com/OfficeDev/ews-java-api/wiki/Getting-Started-Guide#extended-properties

Update : As per the comments we do understand that we have to treat extendedProperty as a column definition and update the same column ...but we couldn't figure out how to achieve this as...Any code samples to point us in the right direction will be of great help

Latest Update : We have deleted some of the extendedPropertyDefinition's but still facing the same invalid property could some one please point us in the right direction

user2359997
  • 561
  • 1
  • 16
  • 40

1 Answers1

1

Is it safe to say that getUniqueId returns a different guid on each call? If so, then that is the problem. Think of the Guid for an extended prop as a namespace. The exchange store limits the number of custom extended props to something like 32k per mailbox. So you are likely hitting that limit. But aside from that, the main reason for creating an extended property is so that you can refer to it later. But if you are basically discarding the namespace each time, you are leaving orphaned props on items. Without understanding your particular scenario, I can only say that the Guid should be thought of truly as a namespace. Choose one for your app/company/scenario and hard code it. They create all the named props you want within that namespace. For instance, "MyProp/String" in Guid namespace 1 is a different property than "MyProp/String" in Guid namespace 2.

  • Thanks a lot for your reply ! we are not discarding the guid we are using it to retrieve the email when the user is trying to reply , our use case is we want to retrieve the email when user is trying to reply (currently we are doing it based on the uid), As you said if we are hitting the 32k limit ..all our users should be effected but only couple of them are effected..so how can we be sure that we are hitting any of the limits it would be of great help – user2359997 Jun 12 '18 at 00:45
  • Also i think we using the guid as per the documentation here https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633654(v%3Dexchg.80) – user2359997 Jun 12 '18 at 01:12
  • I would use one single extended property and set it to a different guid for each email. Think about the extended property definition like a database schema property and every item could have a different value for that property . What you are doing is creating a different schema prop for each email which I don't think is what you want. – David Sterling - MSFT Jun 12 '18 at 03:39
  • Thanks again for your reply ! i understand we have to use extended property as a database schema property ...could you please point us to a code sample on how to do it most of the code samples i look at create a new ExtendedPropertyDefinition with the value of uid as a value in the constructor including this one https://github.com/OfficeDev/ews-java-api/wiki/Getting-Started-Guide#extended-properties – user2359997 Jun 12 '18 at 06:57
  • 1
    Sure. Again, think about the propertySetId as the "column name" in a database. The column can contain lots and lots of different values - one for each record in the table. Taking the example from the GitHub link: UUID yourPropertySetId = UUID.fromString(""); // Define the extended property itself. ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition( yourPropertySetId, "MyProperty", MapiPropertyType.String); // Stamp the extended property message.setExtendedProperty(extendedPropertyDefinition, "MyValue"); – David Sterling - MSFT Jun 26 '18 at 21:22