ruby_odata 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/.gitignore +3 -2
  2. data/.travis.yml +2 -1
  3. data/.yardopts +6 -0
  4. data/CHANGELOG.md +102 -0
  5. data/Guardfile +14 -0
  6. data/README.md +285 -0
  7. data/Rakefile +0 -7
  8. data/features/basic_auth.feature +3 -2
  9. data/features/batch_request.feature +7 -6
  10. data/features/cassettes/basic_auth_protected_resource.yml +57 -0
  11. data/features/cassettes/batch_request_additions.yml +69 -0
  12. data/features/cassettes/batch_request_deletes.yml +69 -0
  13. data/features/cassettes/batch_request_updates.yml +69 -0
  14. data/features/cassettes/clean_database_for_testing.yml +46 -0
  15. data/features/cassettes/cucumber_tags/basic_auth.yml +297 -0
  16. data/features/cassettes/cucumber_tags/batch_request.yml +1459 -0
  17. data/features/cassettes/cucumber_tags/complex_types.yml +326 -0
  18. data/features/cassettes/cucumber_tags/error_handling.yml +64 -0
  19. data/features/cassettes/cucumber_tags/query_builder.yml +2025 -0
  20. data/features/cassettes/cucumber_tags/service.yml +234 -0
  21. data/features/cassettes/cucumber_tags/service_manage.yml +937 -0
  22. data/features/cassettes/cucumber_tags/service_methods.yml +647 -0
  23. data/features/cassettes/cucumber_tags/ssl.yml +203 -0
  24. data/features/cassettes/cucumber_tags/type_conversion.yml +337 -0
  25. data/features/cassettes/service_manage_additions.yml +65 -0
  26. data/features/cassettes/service_manage_deletions.yml +58 -0
  27. data/features/cassettes/service_manage_deletions_2.yml +58 -0
  28. data/features/cassettes/unsecured_metadata.yml +89 -0
  29. data/features/complex_types.feature +4 -3
  30. data/features/error_handling.feature +14 -0
  31. data/features/query_builder.feature +30 -9
  32. data/features/service.feature +4 -3
  33. data/features/service_manage.feature +6 -5
  34. data/features/service_methods.feature +3 -2
  35. data/features/ssl.feature +8 -8
  36. data/features/step_definitions/service_steps.rb +38 -24
  37. data/features/support/env.rb +1 -3
  38. data/features/support/hooks.rb +3 -2
  39. data/features/support/pickle.rb +29 -18
  40. data/features/support/vcr.rb +24 -0
  41. data/features/type_conversion.feature +16 -17
  42. data/lib/ruby_odata/association.rb +7 -6
  43. data/lib/ruby_odata/class_builder.rb +6 -7
  44. data/lib/ruby_odata/exceptions.rb +4 -0
  45. data/lib/ruby_odata/helpers.rb +11 -0
  46. data/lib/ruby_odata/operation.rb +5 -6
  47. data/lib/ruby_odata/property_metadata.rb +4 -5
  48. data/lib/ruby_odata/query_builder.rb +98 -63
  49. data/lib/ruby_odata/service.rb +118 -103
  50. data/lib/ruby_odata/version.rb +3 -1
  51. data/lib/ruby_odata.rb +20 -18
  52. data/ruby_odata.gemspec +16 -12
  53. data/spec/query_builder_spec.rb +78 -14
  54. data/spec/service_spec.rb +83 -83
  55. data/spec/support/sample_service_matcher.rb +15 -0
  56. data/test/RubyODataService/RubyODataService/App_Data/.gitkeep +0 -0
  57. data/test/blueprints.rb +15 -9
  58. data/test/usage_samples/querying.rb +5 -1
  59. data/test/usage_samples/sample_data.rb +1 -3
  60. metadata +213 -39
  61. data/CHANGELOG.rdoc +0 -88
  62. data/README.rdoc +0 -259
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://win7dev:8989/SampleService/RubyOData.svc/Products?$orderby=Name
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Cache-Control:
22
+ - no-cache
23
+ Content-Length:
24
+ - '2702'
25
+ Content-Type:
26
+ - application/atom+xml;type=feed;charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Set-Cookie:
30
+ - ASP.NET_SessionId=qafny5qbazxvbtg3q0znew3e; path=/; HttpOnly
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Dataserviceversion:
34
+ - 1.0;
35
+ X-Aspnet-Version:
36
+ - 4.0.30319
37
+ X-Powered-By:
38
+ - ASP.NET
39
+ Date:
40
+ - Tue, 07 Aug 2012 21:43:15 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: <?xml version="1.0" encoding="utf-8"?><feed xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
44
+ xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
45
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
46
+ xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/RubyOData.svc/Products</id><title
47
+ type="text">Products</title><updated>2012-08-07T21:43:16Z</updated><link rel="self"
48
+ title="Products" href="Products" /><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
49
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
50
+ /><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
51
+ type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
52
+ /><title /><updated>2012-08-07T21:43:16Z</updated><author><name /></author><content
53
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Product
54
+ 1</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">50.00</d:Price><d:DiscontinuedDate
55
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
56
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:CreateDate><d:ModifiedDate
57
+ m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(4)</id><category
58
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
59
+ /><link rel="edit" title="Product" href="Products(4)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
60
+ type="application/atom+xml;type=entry" title="Category" href="Products(4)/Category"
61
+ /><title /><updated>2012-08-07T21:43:16Z</updated><author><name /></author><content
62
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">4</d:Id><d:Name>Product
63
+ 4</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">75.50</d:Price><d:DiscontinuedDate
64
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">4</d:CategoryId><d:AuditFields
65
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:CreateDate><d:ModifiedDate
66
+ m:type="Edm.DateTime">2012-08-07T21:43:16.11</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry></feed>
67
+ http_version: !!null
68
+ recorded_at: Tue, 07 Aug 2012 21:43:16 GMT
69
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://win7dev:8989/SampleService/RubyOData.svc/Products?$orderby=Name
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Cache-Control:
22
+ - no-cache
23
+ Content-Length:
24
+ - '2728'
25
+ Content-Type:
26
+ - application/atom+xml;type=feed;charset=utf-8
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Set-Cookie:
30
+ - ASP.NET_SessionId=xbi0rweg5uqzhtmxau31f0my; path=/; HttpOnly
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Dataserviceversion:
34
+ - 1.0;
35
+ X-Aspnet-Version:
36
+ - 4.0.30319
37
+ X-Powered-By:
38
+ - ASP.NET
39
+ Date:
40
+ - Tue, 07 Aug 2012 21:43:15 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: <?xml version="1.0" encoding="utf-8"?><feed xml:base="http://win7dev:8989/SampleService/RubyOData.svc/"
44
+ xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
45
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
46
+ xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/RubyOData.svc/Products</id><title
47
+ type="text">Products</title><updated>2012-08-07T21:43:15Z</updated><link rel="self"
48
+ title="Products" href="Products" /><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(1)</id><category
49
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
50
+ /><link rel="edit" title="Product" href="Products(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
51
+ type="application/atom+xml;type=entry" title="Category" href="Products(1)/Category"
52
+ /><title /><updated>2012-08-07T21:43:15Z</updated><author><name /></author><content
53
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Product
54
+ 1 - Updated</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">100.00</d:Price><d:DiscontinuedDate
55
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">1</d:CategoryId><d:AuditFields
56
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:CreateDate><d:ModifiedDate
57
+ m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry><entry><id>http://win7dev:8989/SampleService/RubyOData.svc/Products(2)</id><category
58
+ term="RubyODataService.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
59
+ /><link rel="edit" title="Product" href="Products(2)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Category"
60
+ type="application/atom+xml;type=entry" title="Category" href="Products(2)/Category"
61
+ /><title /><updated>2012-08-07T21:43:15Z</updated><author><name /></author><content
62
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">2</d:Id><d:Name>Product
63
+ 2 - Updated</d:Name><d:Description>Test Widget</d:Description><d:Price m:type="Edm.Decimal">100.00</d:Price><d:DiscontinuedDate
64
+ m:type="Edm.DateTime" m:null="true" /><d:CategoryId m:type="Edm.Int32">2</d:CategoryId><d:AuditFields
65
+ m:type="RubyODataService.AuditFields"><d:CreateDate m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:CreateDate><d:ModifiedDate
66
+ m:type="Edm.DateTime">2012-08-07T21:43:15.453</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry></feed>
67
+ http_version: !!null
68
+ recorded_at: Tue, 07 Aug 2012 21:43:15 GMT
69
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://win7dev:8989/SampleService/RubyOData.svc/CleanDatabaseForTesting
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Length:
15
+ - '0'
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 204
23
+ message: No Content
24
+ headers:
25
+ Cache-Control:
26
+ - no-cache
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Set-Cookie:
30
+ - ASP.NET_SessionId=o4ege2gplbuvzbgrt4ij0bku; path=/; HttpOnly
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Dataserviceversion:
34
+ - 1.0;
35
+ X-Aspnet-Version:
36
+ - 4.0.30319
37
+ X-Powered-By:
38
+ - ASP.NET
39
+ Date:
40
+ - Tue, 07 Aug 2012 21:47:39 GMT
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ''
44
+ http_version: !!null
45
+ recorded_at: Tue, 07 Aug 2012 21:47:40 GMT
46
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,297 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories
6
+ body:
7
+ encoding: ASCII-8BIT
8
+ string: ! '{"Name":"Auth Test Category","AuditFields":{"CreatedBy":"Machinist"}}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '69'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Cache-Control:
26
+ - no-cache
27
+ Content-Length:
28
+ - '1278'
29
+ Content-Type:
30
+ - application/atom+xml;type=entry;charset=utf-8
31
+ Location:
32
+ - http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)
33
+ Server:
34
+ - Microsoft-IIS/7.5
35
+ Set-Cookie:
36
+ - ASP.NET_SessionId=b5h3vo0kbga5mdcgu2nfisos; path=/; HttpOnly
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ Dataserviceversion:
40
+ - 1.0;
41
+ X-Aspnet-Version:
42
+ - 4.0.30319
43
+ X-Powered-By:
44
+ - ASP.NET
45
+ Date:
46
+ - Tue, 07 Aug 2012 21:21:24 GMT
47
+ body:
48
+ encoding: US-ASCII
49
+ string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/"
50
+ xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
51
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
52
+ xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)</id><category
53
+ term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
54
+ /><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
55
+ type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
56
+ /><title /><updated>2012-08-07T21:21:25Z</updated><author><name /></author><content
57
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Auth
58
+ Test Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
59
+ m:type="Edm.DateTime">2012-08-07T21:21:25.296875Z</d:CreateDate><d:ModifiedDate
60
+ m:type="Edm.DateTime">2012-08-07T21:21:25.296875Z</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
61
+ http_version: !!null
62
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
63
+ - request:
64
+ method: get
65
+ uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)
66
+ body:
67
+ encoding: US-ASCII
68
+ string: ''
69
+ headers:
70
+ Accept:
71
+ - ! '*/*; q=0.5, application/xml'
72
+ Accept-Encoding:
73
+ - gzip, deflate
74
+ User-Agent:
75
+ - Ruby
76
+ response:
77
+ status:
78
+ code: 200
79
+ message: OK
80
+ headers:
81
+ Cache-Control:
82
+ - no-cache
83
+ Content-Length:
84
+ - '1270'
85
+ Content-Type:
86
+ - application/atom+xml;type=entry;charset=utf-8
87
+ Server:
88
+ - Microsoft-IIS/7.5
89
+ Set-Cookie:
90
+ - ASP.NET_SessionId=vqh02cwip2bvnmgt4smeb5ok; path=/; HttpOnly
91
+ X-Content-Type-Options:
92
+ - nosniff
93
+ Dataserviceversion:
94
+ - 1.0;
95
+ X-Aspnet-Version:
96
+ - 4.0.30319
97
+ X-Powered-By:
98
+ - ASP.NET
99
+ Date:
100
+ - Tue, 07 Aug 2012 21:21:24 GMT
101
+ body:
102
+ encoding: US-ASCII
103
+ string: <?xml version="1.0" encoding="utf-8"?><entry xml:base="http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/"
104
+ xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
105
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss"
106
+ xmlns:gml="http://www.opengis.net/gml"><id>http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/Categories(1)</id><category
107
+ term="RubyODataService.Category" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
108
+ /><link rel="edit" title="Category" href="Categories(1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products"
109
+ type="application/atom+xml;type=feed" title="Products" href="Categories(1)/Products"
110
+ /><title /><updated>2012-08-07T21:21:25Z</updated><author><name /></author><content
111
+ type="application/xml"><m:properties><d:Id m:type="Edm.Int32">1</d:Id><d:Name>Auth
112
+ Test Category</d:Name><d:AuditFields m:type="RubyODataService.AuditFields"><d:CreateDate
113
+ m:type="Edm.DateTime">2012-08-07T21:21:25.297</d:CreateDate><d:ModifiedDate
114
+ m:type="Edm.DateTime">2012-08-07T21:21:25.297</d:ModifiedDate><d:CreatedBy>Machinist</d:CreatedBy></d:AuditFields></m:properties></content></entry>
115
+ http_version: !!null
116
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
117
+ - request:
118
+ method: get
119
+ uri: http://admin:bad_pwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
120
+ body:
121
+ encoding: US-ASCII
122
+ string: ''
123
+ headers:
124
+ Accept:
125
+ - ! '*/*; q=0.5, application/xml'
126
+ Accept-Encoding:
127
+ - gzip, deflate
128
+ User-Agent:
129
+ - Ruby
130
+ response:
131
+ status:
132
+ code: 401
133
+ message: Unauthorized
134
+ headers:
135
+ Content-Type:
136
+ - text/html
137
+ Server:
138
+ - Microsoft-IIS/7.5
139
+ Www-Authenticate:
140
+ - Basic
141
+ X-Powered-By:
142
+ - ASP.NET
143
+ Date:
144
+ - Tue, 07 Aug 2012 21:21:24 GMT
145
+ Content-Length:
146
+ - '1218'
147
+ body:
148
+ encoding: US-ASCII
149
+ string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
150
+ xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>401 - Unauthorized:
151
+ Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
152
+ Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
153
+ 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
154
+ \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
155
+ 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
156
+ 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
157
+ id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
158
+ class=\"content-container\"><fieldset>\r\n <h2>401 - Unauthorized: Access
159
+ is denied due to invalid credentials.</h2>\r\n <h3>You do not have permission
160
+ to view this directory or page using the credentials that you supplied.</h3>\r\n
161
+ </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
162
+ http_version: !!null
163
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
164
+ - request:
165
+ method: get
166
+ uri: http://admin:passwd@win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
167
+ body:
168
+ encoding: US-ASCII
169
+ string: ''
170
+ headers:
171
+ Accept:
172
+ - ! '*/*; q=0.5, application/xml'
173
+ Accept-Encoding:
174
+ - gzip, deflate
175
+ User-Agent:
176
+ - Ruby
177
+ response:
178
+ status:
179
+ code: 200
180
+ message: OK
181
+ headers:
182
+ Cache-Control:
183
+ - no-cache
184
+ Content-Length:
185
+ - '4055'
186
+ Content-Type:
187
+ - application/xml;charset=utf-8
188
+ Server:
189
+ - Microsoft-IIS/7.5
190
+ Set-Cookie:
191
+ - ASP.NET_SessionId=qdj1en0bcagvrdhule4xjvxg; path=/; HttpOnly
192
+ X-Content-Type-Options:
193
+ - nosniff
194
+ Dataserviceversion:
195
+ - 1.0;
196
+ X-Aspnet-Version:
197
+ - 4.0.30319
198
+ X-Powered-By:
199
+ - ASP.NET
200
+ Date:
201
+ - Tue, 07 Aug 2012 21:21:24 GMT
202
+ body:
203
+ encoding: US-ASCII
204
+ string: <?xml version="1.0" encoding="utf-8"?><edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"><edmx:DataServices
205
+ m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema
206
+ Namespace="RubyODataService" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType
207
+ Name="Product"><Key><PropertyRef Name="Id" /></Key><Property Name="Id" Type="Edm.Int32"
208
+ Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
209
+ /><Property Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false"
210
+ Unicode="true" /><Property Name="Description" Type="Edm.String" MaxLength="4000"
211
+ FixedLength="false" Unicode="true" /><Property Name="Price" Type="Edm.Decimal"
212
+ Nullable="false" Precision="18" Scale="2" /><Property Name="DiscontinuedDate"
213
+ Type="Edm.DateTime" /><Property Name="CategoryId" Type="Edm.Int32" Nullable="false"
214
+ /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
215
+ /><NavigationProperty Name="Category" Relationship="RubyODataService.Category_Products"
216
+ ToRole="Category_Products_Source" FromRole="Category_Products_Target" /></EntityType><ComplexType
217
+ Name="AuditFields"><Property Name="CreateDate" Type="Edm.DateTime" Nullable="false"
218
+ /><Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" /><Property
219
+ Name="CreatedBy" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
220
+ /></ComplexType><EntityType Name="Category"><Key><PropertyRef Name="Id" /></Key><Property
221
+ Name="Id" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity"
222
+ xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property
223
+ Name="Name" Type="Edm.String" MaxLength="4000" FixedLength="false" Unicode="true"
224
+ /><Property Name="AuditFields" Type="RubyODataService.AuditFields" Nullable="false"
225
+ /><NavigationProperty Name="Products" Relationship="RubyODataService.Category_Products"
226
+ ToRole="Category_Products_Target" FromRole="Category_Products_Source" /></EntityType><EntityType
227
+ Name="EdmMetadata"><Key><PropertyRef Name="Id" /></Key><Property Name="Id"
228
+ Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
229
+ /><Property Name="ModelHash" Type="Edm.String" MaxLength="4000" FixedLength="false"
230
+ Unicode="true" /></EntityType><Association Name="Category_Products"><End Type="RubyODataService.Product"
231
+ Role="Category_Products_Target" Multiplicity="*" /><End Type="RubyODataService.Category"
232
+ Role="Category_Products_Source" Multiplicity="1"><OnDelete Action="Cascade"
233
+ /></End><ReferentialConstraint><Principal Role="Category_Products_Source"><PropertyRef
234
+ Name="Id" /></Principal><Dependent Role="Category_Products_Target"><PropertyRef
235
+ Name="CategoryId" /></Dependent></ReferentialConstraint></Association><EntityContainer
236
+ Name="RubyODataContext" m:IsDefaultEntityContainer="true"><EntitySet Name="Products"
237
+ EntityType="RubyODataService.Product" /><EntitySet Name="Categories" EntityType="RubyODataService.Category"
238
+ /><EntitySet Name="EdmMetadatas" EntityType="RubyODataService.EdmMetadata"
239
+ /><AssociationSet Name="Category_Products" Association="RubyODataService.Category_Products"><End
240
+ Role="Category_Products_Target" EntitySet="Products" /><End Role="Category_Products_Source"
241
+ EntitySet="Categories" /></AssociationSet><FunctionImport Name="CleanDatabaseForTesting"
242
+ m:HttpMethod="POST" /><FunctionImport Name="EntityCategoryWebGet" ReturnType="Collection(RubyODataService.Category)"
243
+ EntitySet="Categories" m:HttpMethod="GET" /><FunctionImport Name="CategoryNames"
244
+ ReturnType="Collection(Edm.String)" m:HttpMethod="GET" /><FunctionImport Name="FirstCategoryId"
245
+ ReturnType="Edm.Int32" m:HttpMethod="GET" /><FunctionImport Name="EntitySingleCategoryWebGet"
246
+ ReturnType="RubyODataService.Category" EntitySet="Categories" m:HttpMethod="GET"><Parameter
247
+ Name="id" Type="Edm.Int32" /></FunctionImport></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>
248
+ http_version: !!null
249
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
250
+ - request:
251
+ method: get
252
+ uri: http://win7dev:8989/SampleService/BasicAuth/RubyOData.svc/$metadata
253
+ body:
254
+ encoding: US-ASCII
255
+ string: ''
256
+ headers:
257
+ Accept:
258
+ - ! '*/*; q=0.5, application/xml'
259
+ Accept-Encoding:
260
+ - gzip, deflate
261
+ User-Agent:
262
+ - Ruby
263
+ response:
264
+ status:
265
+ code: 401
266
+ message: Unauthorized
267
+ headers:
268
+ Content-Type:
269
+ - text/html
270
+ Server:
271
+ - Microsoft-IIS/7.5
272
+ Www-Authenticate:
273
+ - Basic
274
+ X-Powered-By:
275
+ - ASP.NET
276
+ Date:
277
+ - Tue, 07 Aug 2012 21:21:24 GMT
278
+ Content-Length:
279
+ - '1218'
280
+ body:
281
+ encoding: US-ASCII
282
+ string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
283
+ xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>401 - Unauthorized:
284
+ Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
285
+ Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
286
+ 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
287
+ \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
288
+ 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
289
+ 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
290
+ id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
291
+ class=\"content-container\"><fieldset>\r\n <h2>401 - Unauthorized: Access
292
+ is denied due to invalid credentials.</h2>\r\n <h3>You do not have permission
293
+ to view this directory or page using the credentials that you supplied.</h3>\r\n
294
+ </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
295
+ http_version: !!null
296
+ recorded_at: Tue, 07 Aug 2012 21:21:25 GMT
297
+ recorded_with: VCR 2.2.4