rews 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -1,10 +1,11 @@
1
1
  = rews
2
2
 
3
- Rews is a simple Ruby client for Exchange Web Services.
3
+ Rews is a simple Ruby client for Exchange Web Services. It has been tested against Exchange 2007 SP1 and Exchange 2010 RTM
4
4
 
5
- * Searching, fetching and deletion are supported.
5
+ * Find, Get and Delete of Items and Folders is supported.
6
6
  * Filtering, ordering, and arbitrary property retrieval are supported.
7
7
  * Bulk operations are supported
8
+ * Runs on both CRuby and JRuby
8
9
 
9
10
  Method names generally follow the Exchange Web Services API
10
11
  http://msdn.microsoft.com/en-us/library/bb409286(EXCHG.140).aspx
@@ -14,7 +15,7 @@ to use :
14
15
  # create a client
15
16
  c = Rews::Client.new("https://exchange.bar.com/EWS/Exchange.asmx", :ntlm, 'EXCHDOM\foo', 'password')
16
17
 
17
- # find a distinguished folder from any one of the mailboxes the user has permissions for
18
+ # find a distinguished folder from one of the mailboxes the user has permissions for
18
19
  inbox=c.distinguished_folder_id('inbox', 'foo@bar.com')
19
20
 
20
21
  # find some message_ids,
@@ -35,12 +36,14 @@ to use :
35
36
 
36
37
  == Install
37
38
 
38
- to use NTLM authentication, you need versions of httpclient and ntlm-http
39
- gems with fixes for NTLM authentication
39
+ slightly painful : to use NTLM authentication, you need versions of httpclient and ntlm-http
40
+ gems with fixes for NTLM authentication
40
41
 
41
42
  * httpclient branch ntlm_domain : https://github.com/mccraigmccraig/httpclient/tree/ntlm_domain
42
43
  * ntlm-http branch fix_unicode : https://github.com/trampoline/ntlm-http/tree/fix_unicode
43
44
 
45
+ then:
46
+
44
47
  gem install rews
45
48
 
46
49
  == Note on Patches/Pull Requests
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
data/lib/rews/folder.rb CHANGED
@@ -97,6 +97,7 @@ module Rews
97
97
 
98
98
  r = with_error_check(client, :find_folder_response, :response_messages, :find_folder_response_message) do
99
99
  client.savon_client.request(:wsdl, "FindFolder", "Traversal"=>"Shallow") do
100
+ http.headers["SOAPAction"] = "\"#{SCHEMA_MESSAGES}/FindFolder\"" # required by EWS 2007
100
101
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
101
102
  xml = Builder::XmlMarkup.new
102
103
 
@@ -144,6 +145,8 @@ module Rews
144
145
 
145
146
  r = with_error_check(client, :find_item_response, :response_messages, :find_item_response_message) do
146
147
  client.savon_client.request(:wsdl, "FindItem", "Traversal"=>"Shallow") do
148
+ http.headers["SOAPAction"] = "\"#{SCHEMA_MESSAGES}/FindItem\"" # required by EWS 2007
149
+
147
150
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
148
151
 
149
152
  xml = Builder::XmlMarkup.new
@@ -192,6 +195,7 @@ module Rews
192
195
 
193
196
  r = with_error_check(client, :get_item_response,:response_messages,:get_item_response_message) do
194
197
  client.savon_client.request(:wsdl, "GetItem") do
198
+ http.headers["SOAPAction"] = "\"#{SCHEMA_MESSAGES}/GetItem\"" # required by EWS 2007
195
199
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
196
200
 
197
201
  xml = Builder::XmlMarkup.new
@@ -224,6 +228,7 @@ module Rews
224
228
 
225
229
  r = with_error_check(client, :delete_item_response, :response_messages, :delete_item_response_message) do
226
230
  client.savon_client.request(:wsdl, "DeleteItem", :DeleteType=>opts[:delete_type]) do
231
+ http.headers["SOAPAction"] = "\"#{SCHEMA_MESSAGES}/DeleteItem\"" # required by EWS 2007
227
232
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
228
233
 
229
234
  xml = Builder::XmlMarkup.new
data/lib/rews/item.rb CHANGED
@@ -93,6 +93,7 @@ module Rews
93
93
  opts = check_opts(GET_ITEM_OPTS, opts)
94
94
  r = with_error_check(client, :get_item_response,:response_messages,:get_item_response_message) do
95
95
  client.savon_client.request(:wsdl, "GetItem") do
96
+ http.headers["SOAPAction"] = "\"#{SCHEMA_MESSAGES}/GetItem\"" # required by EWS 2007
96
97
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
97
98
 
98
99
  xml = Builder::XmlMarkup.new
@@ -118,6 +119,7 @@ module Rews
118
119
  opts = check_opts(DELETE_ITEM_OPTS, opts)
119
120
  r = with_error_check(client, :delete_item_response, :response_messages, :delete_item_response_message) do
120
121
  client.savon_client.request(:wsdl, "DeleteItem", :DeleteType=>opts[:delete_type]) do
122
+ http.headers["SOAPAction"] = "\"#{SCHEMA_MESSAGES}/DeleteItem\"" # required by EWS 2007
121
123
  soap.namespaces["xmlns:t"]=SCHEMA_TYPES
122
124
 
123
125
  xml = Builder::XmlMarkup.new
@@ -2,8 +2,10 @@
2
2
  # like the Savon Client
3
3
  class RequestProxy
4
4
  attr_accessor :soap
5
+ attr_accessor :http
5
6
  def initialize
6
7
  @soap=Object.new
8
+ @http=Object.new
7
9
  end
8
10
 
9
11
  def eval_with_delegation(&block)
@@ -94,6 +94,7 @@ module Rews
94
94
  block = args.last # block is the last arg
95
95
 
96
96
  ctx = RequestProxy.new()
97
+ mock(ctx.http).headers.mock!["SOAPAction"]="\"#{SCHEMA_MESSAGES}/#{action}\""
97
98
  ns = Object.new
98
99
  mock(ctx.soap).namespaces{ns}
99
100
  mock(ns)["xmlns:t"]=Rews::SCHEMA_TYPES
@@ -106,6 +106,7 @@ module Rews
106
106
  block = args.last # block is the last arg
107
107
 
108
108
  ctx = RequestProxy.new()
109
+ mock(ctx.http).headers.mock!["SOAPAction"]="\"#{SCHEMA_MESSAGES}/#{action}\""
109
110
  ns = Object.new
110
111
  mock(ctx.soap).namespaces{ns}
111
112
  mock(ns)["xmlns:t"]=Rews::SCHEMA_TYPES
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rews
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 6
10
- version: 0.2.6
9
+ - 7
10
+ version: 0.2.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Trampoline Systems Ltd
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-22 00:00:00 +00:00
18
+ date: 2011-03-23 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency