nmarus / node-ews

A simple JSON wrapper for the Exchange Web Services (EWS) SOAP API.
MIT License
116 stars 52 forks source link

Error while trying to cancel an appointment #78

Closed jooles closed 6 years ago

jooles commented 6 years ago

Hi there,

first: keep up the work with this module! Saved so much headache.. While adding Appointments works fine, cancellation of appointments does not.

This is the JSON I use:


        let ewsArgs     = {
            "attributes": {
                "MessageDisposition": "SendAndSaveCopy"
            },
            "SavedItemFolderId": {
                "DistinguishedFolderId": {
                    "attributes": {
                        "Id": "calendar"
                    }
                }
            },
            "Items": {
                "CancelCalendarItem": {
                    "ReferenceItemId": {
                        "attributes": {
                            "Id": "aMeetingId",
                            "ChangeKey": "aChangeKey"
                        }
                    },
                    "NewBodyContent": {
                        "attributes": {
                            "BodyType": "HTML"
                        },
                        "$value": "Just testing."
                    }
                }
            }
        };

The error I get back is (shortened):

`"$value": "The request failed schema validation: 'ns1' is an undeclared namespace. Line 1, position 1268."`

When leaving out the ReferenceItemId completely it tells me that this is missing, but when I re-add it again I get the error posted above.

Can anyone help?
Thanks in advance and best,
Julian
jooles commented 6 years ago

Got it working..

adding the t: ns-prefix to CancelCalendarItem, ReferenceItemId and NewBodyContent solved it! :)