EWS: error when trying to create appointment

Using the latest version (and also older versions), I am getting an Exchange error when trying to create an appointment using IEWSClient: “ExchangeException: set action is invalid for property”.

This code (from your documentation) does not work for me:

IEWSClient client = ...;
java.util.Calendar c = java.util.Calendar.getInstance();
        c.set(java.util.Calendar.MINUTE, 0);
        c.set(java.util.Calendar.SECOND, 0);
        c.set(java.util.Calendar.MILLISECOND, 0);
        Date startTime = c.getTime();
        c.add(java.util.Calendar.HOUR_OF_DAY, 1);
        Date endTime = c.getTime();
        String timeZone = "America/New_York";

        Appointment app = new Appointment("Room 112", startTime, endTime, MailAddress.to_MailAddress("organizeraspose-email.test3@domain.com"),
                MailAddressCollection.to_MailAddressCollection("attendee@gmail.com"));
        app.setTimeZone(timeZone);
        app.setSummary("NETWORKNET-34136" + UUID.randomUUID().toString());
        app.setDescription("NETWORKNET-34136 Exchange 2007/EWS: Provide support for Add/Update/Delete calendar items");

        String uid = client.createAppointment(app);

Could you please look into this?

@arne411

Summary
You are receiving an ExchangeException: set action is invalid for property when calling client.createAppointment(app) with the Aspose.Email EWS SDK.

Why it happens
The SDK builds a SOAP request that includes one or more properties which the target Exchange server rejects. This can be caused by:

  • Setting a property that is not supported by the specific Exchange version you are connecting to (e.g., certain time‑zone related elements on older servers).
  • Supplying values that do not match the expected format or type for the server.
  • Using a constructor that automatically populates fields which may not be valid for your environment.

What to do next

  1. Enable request tracing to see the exact XML that is sent to the server.
client.setTraceEnabled(true); // logs raw request/response XML

Run the code again and examine the logged request for any property that looks unusual (e.g., <TimeZone>, <Start>, <End>).

  1. Try creating the appointment without setting the time‑zone explicitly. Convert your Date values to the desired zone before passing them to the SDK and omit app.setTimeZone(...).
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("America/New_York"));
// set minutes, seconds, etc. as in your original code
Date startTime = cal.getTime();
cal.add(Calendar.HOUR_OF_DAY, 1);
Date endTime = cal.getTime();

Appointment app = new Appointment();
app.setLocation("Room 112");
app.setStart(startTime);
app.setEnd(endTime);
app.setOrganizer(MailAddress.to_MailAddress("organizeraspose-email.test3@domain.com"));
app.getAttendees().add(MailAddress.to_MailAddress("attendee@gmail.com"));
app.setSummary("NETWORKNET-34136-" + UUID.randomUUID());
app.setDescription("NETWORKNET-34136 Exchange: Provide support for Add/Update/Delete calendar items");
// Do NOT call app.setTimeZone(...);
String uid = client.createAppointment(app);
  1. Verify server version and mailbox permissions. Make sure the mailbox used for the organizer has rights to create items in the target calendar and that the Exchange version you are connecting to supports the properties you are setting.

  2. If the problem persists, capture the traced XML and share the following information with Aspose support:

  • Full request/response XML.
  • Exact Exchange server version (including service pack level).
  • SDK version you are using.
  • Whether the organizer mailbox is the same mailbox whose calendar is being written to or a delegate.

Providing these details will help the support team pinpoint the unsupported property and suggest a precise fix.

Note: The steps above are based on typical causes of the set action is invalid for property error. If you discover a different property is causing the issue, adjust the code accordingly or consult the Aspose.Email documentation for that property.

:warning: I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.

@arne411
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): EMAILJAVA-35422

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hello @arne411 ,

Thank you for your report.

We have analyzed the issue related to the “ExchangeException: set action is invalid for property” error when creating an appointment using IEWSClient. The problem has been successfully reproduced on our side.

The root cause has been identified and the issue has now been fixed internally. The correction will be included in the upcoming 25.12 release, which is scheduled for publication in the first days of December.

Please update to version 25.12 once it becomes available. This release will resolve the reported issue. Should you experience any further difficulties, please feel free to contact us.