nmarus / node-ews

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

Repeating XML items only pass the last item #24

Closed ng-marcus closed 7 years ago

ng-marcus commented 8 years ago

Where the schema defines multiple entries with the same name, only the last one is used, for example FindItem includes `

      <t:FieldURI FieldURI="calendar:Start" />
      <t:FieldURI FieldURI="calendar:End" />
    </t:AdditionalProperties>`  

but if I code this as

'AdditionalProperties': { 'FieldURI': { 'attributes': { 'FieldURI': 'item:Subject', }, }, 'FieldURI': { 'attributes': { 'FieldURI': 'calendar:Start', } }, 'FieldURI': { 'attributes': { 'FieldURI': 'calendar:End', } } },

only the calendar:End attribute is returned in the reply.

kcastrotech commented 8 years ago

That is actually part of the node-soap object to XML engine and to achieve what you're wanting you'll need to pass FieldURI as an array. So try this: 'AdditionalProperties': { 'FieldURI': [{ 'attributes': { 'FieldURI': 'item:Subject'}},{ 'attributes': { 'FieldURI': 'calendar:Start'}},{ 'attributes': { 'FieldURI': 'calendar:End'}}] },

kcastrotech commented 8 years ago

@ng-marcus - Can you confirm if that fixed your issue?

Smus commented 7 years ago

Had same issue.. this worked for me:

'AdditionalProperties':{ "FieldURI": [ {"FieldURI": "item:Subject"}, {"FieldURI": "calendar:Start"}, {"FieldURI": "calendar:End"} ] }

afreeland commented 7 years ago

This would be a great addition to the README.md...was thankful be able to search for this in the issues.