Open ghost opened 9 years ago
I found that by commenting out the line in the ews_data_services.rb for both the copy_item and move_item methods it would then work. This was the line I commented out. builder.return_new_item_ids!(return_new_ids)
See http://stackoverflow.com/a/19574710/2298386 - you need to have server version 2010 or newer and set :server_version
when initialising your EWSClient instance.
here is a monkey patch for @jakesandwich's solution. it would also be possible to leave the function body empty but i ditn't know if it breaks or fixes other things so i left it like jake
module FixOldEwsBuilder
def return_new_item_ids!(opts)
super unless ['move_item', 'copy_item'].include? caller_locations(1,1).first.base_label
end
end
Viewpoint::EWS::SOAP::EwsBuilder.prepend FixOldEwsBuilder
this is a duplicate of #130
Hello, I've been having some issues with moving or copying messages to folders. I get the following error.
Viewpoint::EWS::Errors::SoapResponseError: SOAP Error: Message: The request failed schema validation: The element 'MoveItem' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'ReturnNewItemIds' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. Code: a:ErrorSchemaValidation
This is how I'm currently trying to move the message...
cli = Viewpoint::EWSClient.new(endpoint, username, password) inbox = cli.get_folder :inbox new_folder = cli.get_folder_by_name 'Processed'
first_message = inbox.messages(indexed_page_item_view: {'MaxEntriesReturned' => 1, 'Offset' => 1, 'BasePoint' => 'Beginning'}).first
first_message.move!(new_folder.id)
I have also tried first_message.move(new_folder) both do not work.
This is where the error is triggered. Is there something I'm missing?