WinRb / Viewpoint

A Ruby client access library for Microsoft Exchange Web Services (EWS)
Apache License 2.0
248 stars 171 forks source link

Body missing - HTTP Error Code: 404 #246

Open praneethpatlola opened 8 years ago

praneethpatlola commented 8 years ago

I am trying to retrieve particular messages. I am able to get item.subject, item.from.email, item.from.name but never item.body. Its throws 404 error.

Are there any options I need to set while instantiating the client or within get_folder() to get the email body? Or is there a different way to get this.

require 'viewpoint' include Viewpoint::EWS endpoint = "https://outlook.office365.com/EWS/Exchanger.asmx" user = 'xxx' pass = 'xxx' client = Viewpoint::EWSClient.new(endpoint, user, pass) inbox = client.get_folder(:inbox) inbox.items_between(Date.today-(i+5),Date.today-i).last.body Viewpoint::EWS::Errors::ResponseError: HTTP Error Code: 404, Msg: from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/connection.rb:112:in check_response' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/connection.rb:89:inpost' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/connection.rb:67:in dispatch' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/soap/exchange_web_service.rb:212:indo_soap_request' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/soap/exchange_data_services.rb:87:in get_item' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/types/item.rb:313:inget_item' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/types/item.rb:117:in get_all_properties!' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/types.rb:63:indeepen!' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/types.rb:135:in rescue in resolve_method' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/types.rb:128:inresolve_method' from /Users/ppatlola/.rvm/gems/ruby-1.9.3-p551/gems/viewpoint-1.0.0/lib/ews/types.rb:26:in method_missing' from (irb):234 from /Users/ppatlola/.rvm/rubies/ruby-1.9.3-p551/bin/irb:12:in

'

timkrins commented 6 years ago

I have not had your exact issue, but I was trying to connect to a similar endpoint. It turns out that my endpoint was incorrect (and returning a 404, even though the basic authentication was still being requested).

In the end, I changed Exchanger.asmx to Exchange.asmx