Commit 8e39c81d1274ae661e9c9baa5fefcc56baec0a85
Committed by
GitHub
Merge pull request #4 from wildland/logon-errors
Logon errors
Showing
12 changed files
with
104 additions
and
51 deletions
Show diff stats
lib/syspro/logon.rb
@@ -10,6 +10,7 @@ module Syspro | @@ -10,6 +10,7 @@ module Syspro | ||
10 | 'CompanyPassword' => company_password | 10 | 'CompanyPassword' => company_password |
11 | } | 11 | } |
12 | resp = request(:get, resource_url, params) | 12 | resp = request(:get, resource_url, params) |
13 | + handle_errors(resp) | ||
13 | UserIdObject.new(resp[0].http_body) | 14 | UserIdObject.new(resp[0].http_body) |
14 | end | 15 | end |
15 | 16 | ||
@@ -17,6 +18,11 @@ module Syspro | @@ -17,6 +18,11 @@ module Syspro | ||
17 | '/Logon' | 18 | '/Logon' |
18 | end | 19 | end |
19 | 20 | ||
21 | + def self.handle_errors(resp) | ||
22 | + body = resp[0].http_body | ||
23 | + raise AuthenticationError, body if body =~ /^(ERROR)/ | ||
24 | + end | ||
25 | + | ||
20 | UserIdObject = Struct.new(:guid) | 26 | UserIdObject = Struct.new(:guid) |
21 | end | 27 | end |
22 | end | 28 | end |
test/cassettes/test_client_block_execution.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,10 +27,10 @@ http_interactions: | @@ -27,10 +27,10 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:23:43 GMT | 30 | + - Mon, 14 May 2018 20:17:40 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | string: 7.0.0.6 | 33 | string: 7.0.0.6 |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:23:42 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:40 GMT |
36 | recorded_with: VCR 4.0.0 | 36 | recorded_with: VCR 4.0.0 |
test/cassettes/test_get_syspro_version.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,10 +27,10 @@ http_interactions: | @@ -27,10 +27,10 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:23:43 GMT | 30 | + - Mon, 14 May 2018 20:17:40 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | string: 7.0.0.6 | 33 | string: 7.0.0.6 |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:23:42 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:40 GMT |
36 | recorded_with: VCR 4.0.0 | 36 | recorded_with: VCR 4.0.0 |
test/cassettes/test_logoff_error.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,10 +27,10 @@ http_interactions: | @@ -27,10 +27,10 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:22:53 GMT | 30 | + - Mon, 14 May 2018 20:17:51 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | string: 'ERROR: Unable to read the SYSPRO base directory registry string BaseDir8' | 33 | string: 'ERROR: Unable to read the SYSPRO base directory registry string BaseDir8' |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:22:52 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:50 GMT |
36 | recorded_with: VCR 4.0.0 | 36 | recorded_with: VCR 4.0.0 |
test/cassettes/test_logon.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,10 +27,10 @@ http_interactions: | @@ -27,10 +27,10 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:23:52 GMT | 30 | + - Mon, 14 May 2018 20:17:49 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | - string: 'EC3098D6E284FB44ADF10671B3F06FCA00 ' | 33 | + string: 'DC3EC6C004B7FF4B8BF56FF221315DAA00 ' |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:23:51 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:48 GMT |
36 | recorded_with: VCR 4.0.0 | 36 | recorded_with: VCR 4.0.0 |
1 | +--- | ||
2 | +http_interactions: | ||
3 | +- request: | ||
4 | + method: get | ||
5 | + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/logon?CompanyId=L&CompanyPassword=&Operator=wland&OperatorPassword=bad_password | ||
6 | + body: | ||
7 | + encoding: US-ASCII | ||
8 | + string: '' | ||
9 | + headers: | ||
10 | + User-Agent: | ||
11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 | ||
12 | + Content-Type: | ||
13 | + - application/x-www-form-urlencoded | ||
14 | + Accept-Encoding: | ||
15 | + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 | ||
16 | + Accept: | ||
17 | + - "*/*" | ||
18 | + response: | ||
19 | + status: | ||
20 | + code: 200 | ||
21 | + message: OK | ||
22 | + headers: | ||
23 | + Content-Length: | ||
24 | + - '32' | ||
25 | + Content-Type: | ||
26 | + - application/octet-stream | ||
27 | + Server: | ||
28 | + - Microsoft-HTTPAPI/2.0 | ||
29 | + Date: | ||
30 | + - Mon, 14 May 2018 20:17:51 GMT | ||
31 | + body: | ||
32 | + encoding: UTF-8 | ||
33 | + string: 'ERROR: Invalid operator password' | ||
34 | + http_version: | ||
35 | + recorded_at: Mon, 14 May 2018 20:17:50 GMT | ||
36 | +recorded_with: VCR 4.0.0 |
test/cassettes/test_query_browse.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,21 +27,21 @@ http_interactions: | @@ -27,21 +27,21 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:23:03 GMT | 30 | + - Mon, 14 May 2018 20:17:02 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | - string: '64C41E1DEB73024CA660211DE643705700 ' | 33 | + string: 'B417B48864C0814DA59D1F349AEC8D8A00 ' |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:23:01 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:01 GMT |
36 | - request: | 36 | - request: |
37 | method: get | 37 | method: get |
38 | - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Browse?UserId=64C41E1DEB73024CA660211DE643705700%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CBrowse%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMBRW.XSD%22%3E%0A%20%20%3CBrowseName%3EInvMaster%3C/BrowseName%3E%0A%20%20%3CStartAtKey/%3E%0A%20%20%3CStartCondition%3E%3C/StartCondition%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%0A%20%20%3CBrowseDetails%3E%0A%20%20%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%20%20%3CTitle%3EStockCodes%3C/Title%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3E%0A%20%20%20%20%20%20%20%20%3CColumnName%3EStockCode%3C/ColumnName%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/BrowseDetails%3E%0A%3C/Browse%3E%0A%0A | 38 | + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Browse?UserId=B417B48864C0814DA59D1F349AEC8D8A00%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CBrowse%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMBRW.XSD%22%3E%0A%20%20%3CBrowseName%3EInvMaster%3C/BrowseName%3E%0A%20%20%3CStartAtKey/%3E%0A%20%20%3CStartCondition%3E%3C/StartCondition%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%0A%20%20%3CBrowseDetails%3E%0A%20%20%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%20%20%3CTitle%3EStockCodes%3C/Title%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3E%0A%20%20%20%20%20%20%20%20%3CColumnName%3EStockCode%3C/ColumnName%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/BrowseDetails%3E%0A%3C/Browse%3E%0A%0A |
39 | body: | 39 | body: |
40 | encoding: US-ASCII | 40 | encoding: US-ASCII |
41 | string: '' | 41 | string: '' |
42 | headers: | 42 | headers: |
43 | User-Agent: | 43 | User-Agent: |
44 | - - Syspro/7 RubyBindings/0.1.0 | 44 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
45 | Content-Type: | 45 | Content-Type: |
46 | - application/x-www-form-urlencoded | 46 | - application/x-www-form-urlencoded |
47 | Accept-Encoding: | 47 | Accept-Encoding: |
@@ -60,7 +60,7 @@ http_interactions: | @@ -60,7 +60,7 @@ http_interactions: | ||
60 | Server: | 60 | Server: |
61 | - Microsoft-HTTPAPI/2.0 | 61 | - Microsoft-HTTPAPI/2.0 |
62 | Date: | 62 | Date: |
63 | - - Fri, 06 Apr 2018 19:23:07 GMT | 63 | + - Mon, 14 May 2018 20:17:06 GMT |
64 | body: | 64 | body: |
65 | encoding: UTF-8 | 65 | encoding: UTF-8 |
66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<InvMaster Language='05' | 66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<InvMaster Language='05' |
@@ -68,5 +68,5 @@ http_interactions: | @@ -68,5 +68,5 @@ http_interactions: | ||
68 | OperatorPrimaryRole=' '>\n<Title>StockCodes</Title>\n<Row>\n<StockCode>\n<Value>02</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>021</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>0214011IFF</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>022</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>023</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<NextPrevKey>\n<PrevKey>02</PrevKey>\n<NextKey>023</NextKey>\n<Fwd>True</Fwd>\n<Back>False</Back>\n</NextPrevKey>\n<HeaderDetails>\n<Header>Stock | 68 | OperatorPrimaryRole=' '>\n<Title>StockCodes</Title>\n<Row>\n<StockCode>\n<Value>02</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>021</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>0214011IFF</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>022</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<Row>\n<StockCode>\n<Value>023</Value>\n<DataType>AlphaNumeric</DataType>\n</StockCode>\n</Row>\n<NextPrevKey>\n<PrevKey>02</PrevKey>\n<NextKey>023</NextKey>\n<Fwd>True</Fwd>\n<Back>False</Back>\n</NextPrevKey>\n<HeaderDetails>\n<Header>Stock |
69 | code</Header>\n<Key>StockCode</Key>\n<KeyDescription>Stock code</KeyDescription>\n<Table>InvMaster</Table>\n</HeaderDetails>\n</InvMaster>\n " | 69 | code</Header>\n<Key>StockCode</Key>\n<KeyDescription>Stock code</KeyDescription>\n<Table>InvMaster</Table>\n</HeaderDetails>\n</InvMaster>\n " |
70 | http_version: | 70 | http_version: |
71 | - recorded_at: Fri, 06 Apr 2018 19:23:06 GMT | 71 | + recorded_at: Mon, 14 May 2018 20:17:05 GMT |
72 | recorded_with: VCR 4.0.0 | 72 | recorded_with: VCR 4.0.0 |
test/cassettes/test_query_fetch.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,21 +27,21 @@ http_interactions: | @@ -27,21 +27,21 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:23:16 GMT | 30 | + - Mon, 14 May 2018 20:17:15 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | - string: '5B21680F424424498B7CE7CCDA98B41700 ' | 33 | + string: '9A5B2797B021A04DA9E933CBCF3CB59700 ' |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:23:15 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:14 GMT |
36 | - request: | 36 | - request: |
37 | method: get | 37 | method: get |
38 | - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Fetch?UserId=5B21680F424424498B7CE7CCDA98B41700%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CFetch%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFCH.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CKey%3E02%3C/Key%3E%0A%20%20%0A%20%20%3CFullKeyProvided%3EY%3C/FullKeyProvided%3E%0A%20%20%3CDefaultType%3E%3C/DefaultType%3E%0A%20%20%3CEspressoFetch%3EN%3C/EspressoFetch%3E%0A%3C/Fetch%3E%0A%0A | 38 | + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Fetch?UserId=9A5B2797B021A04DA9E933CBCF3CB59700%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CFetch%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFCH.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CKey%3E02%3C/Key%3E%0A%20%20%0A%20%20%3CFullKeyProvided%3EY%3C/FullKeyProvided%3E%0A%20%20%3CDefaultType%3E%3C/DefaultType%3E%0A%20%20%3CEspressoFetch%3EN%3C/EspressoFetch%3E%0A%3C/Fetch%3E%0A%0A |
39 | body: | 39 | body: |
40 | encoding: US-ASCII | 40 | encoding: US-ASCII |
41 | string: '' | 41 | string: '' |
42 | headers: | 42 | headers: |
43 | User-Agent: | 43 | User-Agent: |
44 | - - Syspro/7 RubyBindings/0.1.0 | 44 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
45 | Content-Type: | 45 | Content-Type: |
46 | - application/x-www-form-urlencoded | 46 | - application/x-www-form-urlencoded |
47 | Accept-Encoding: | 47 | Accept-Encoding: |
@@ -60,7 +60,7 @@ http_interactions: | @@ -60,7 +60,7 @@ http_interactions: | ||
60 | Server: | 60 | Server: |
61 | - Microsoft-HTTPAPI/2.0 | 61 | - Microsoft-HTTPAPI/2.0 |
62 | Date: | 62 | Date: |
63 | - - Fri, 06 Apr 2018 19:23:26 GMT | 63 | + - Mon, 14 May 2018 20:17:23 GMT |
64 | body: | 64 | body: |
65 | encoding: UTF-8 | 65 | encoding: UTF-8 |
66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<InvMaster Language='05' | 66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<InvMaster Language='05' |
@@ -92,5 +92,5 @@ http_interactions: | @@ -92,5 +92,5 @@ http_interactions: | ||
92 | \ 0.000</LoadingFactor>\n<SupplUnitCode/>\n<StorageSecurity/>\n<StorageHazard/>\n<StorageCondition/>\n<ProductShelfLife> | 92 | \ 0.000</LoadingFactor>\n<SupplUnitCode/>\n<StorageSecurity/>\n<StorageHazard/>\n<StorageCondition/>\n<ProductShelfLife> |
93 | \ 0</ProductShelfLife>\n<InternalShelfLife> 0</InternalShelfLife>\n<AltMethodFlag/>\n<AltSisoFlag/>\n<AltReductionFlag/>\n<WithTaxExpenseType/>\n</InvMaster>\n " | 93 | \ 0</ProductShelfLife>\n<InternalShelfLife> 0</InternalShelfLife>\n<AltMethodFlag/>\n<AltSisoFlag/>\n<AltReductionFlag/>\n<WithTaxExpenseType/>\n</InvMaster>\n " |
94 | http_version: | 94 | http_version: |
95 | - recorded_at: Fri, 06 Apr 2018 19:23:24 GMT | 95 | + recorded_at: Mon, 14 May 2018 20:17:22 GMT |
96 | recorded_with: VCR 4.0.0 | 96 | recorded_with: VCR 4.0.0 |
test/cassettes/test_query_query.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,21 +27,21 @@ http_interactions: | @@ -27,21 +27,21 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:23:35 GMT | 30 | + - Mon, 14 May 2018 20:17:32 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | - string: '5810EEA000F1F04BA915BAF98CA700EE00 ' | 33 | + string: '34C603B5A0981D40BCB1B2E4111B1A5900 ' |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:23:33 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:31 GMT |
36 | - request: | 36 | - request: |
37 | method: get | 37 | method: get |
38 | - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=COMFND&UserId=5810EEA000F1F04BA915BAF98CA700EE00%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFND.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%3CColumns%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/Columns%3E%0A%20%20%0A%20%20%20%20%3CWhere%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3CExpression%3E%0A%20%20%20%20%20%20%20%20%20%20%3COpenBracket%3E(%3C/OpenBracket%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CAndOr%3EAnd%3C/AndOr%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCondition%3EEQ%3C/Condition%3E%0A%20%20%20%20%20%20%20%20%20%20%3CValue%3E02%3C/Value%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCloseBracket%3E)%3C/CloseBracket%3E%0A%20%20%20%20%20%20%20%20%3C/Expression%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%3C/Where%3E%0A%20%20%0A%20%20%3COrderBy%3E%0A%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%3C/OrderBy%3E%0A%3C/Query%3E%0A | 38 | + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=COMFND&UserId=34C603B5A0981D40BCB1B2E4111B1A5900%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFND.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%3CColumns%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/Columns%3E%0A%20%20%0A%20%20%20%20%3CWhere%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3CExpression%3E%0A%20%20%20%20%20%20%20%20%20%20%3COpenBracket%3E(%3C/OpenBracket%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CAndOr%3EAnd%3C/AndOr%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCondition%3EEQ%3C/Condition%3E%0A%20%20%20%20%20%20%20%20%20%20%3CValue%3E02%3C/Value%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCloseBracket%3E)%3C/CloseBracket%3E%0A%20%20%20%20%20%20%20%20%3C/Expression%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%3C/Where%3E%0A%20%20%0A%20%20%3COrderBy%3E%0A%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%3C/OrderBy%3E%0A%3C/Query%3E%0A |
39 | body: | 39 | body: |
40 | encoding: US-ASCII | 40 | encoding: US-ASCII |
41 | string: '' | 41 | string: '' |
42 | headers: | 42 | headers: |
43 | User-Agent: | 43 | User-Agent: |
44 | - - Syspro/7 RubyBindings/0.1.0 | 44 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
45 | Content-Type: | 45 | Content-Type: |
46 | - application/x-www-form-urlencoded | 46 | - application/x-www-form-urlencoded |
47 | Accept-Encoding: | 47 | Accept-Encoding: |
@@ -60,7 +60,7 @@ http_interactions: | @@ -60,7 +60,7 @@ http_interactions: | ||
60 | Server: | 60 | Server: |
61 | - Microsoft-HTTPAPI/2.0 | 61 | - Microsoft-HTTPAPI/2.0 |
62 | Date: | 62 | Date: |
63 | - - Fri, 06 Apr 2018 19:23:43 GMT | 63 | + - Mon, 14 May 2018 20:17:40 GMT |
64 | body: | 64 | body: |
65 | encoding: UTF-8 | 65 | encoding: UTF-8 |
66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<InvMaster Language='05' | 66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<InvMaster Language='05' |
@@ -68,5 +68,5 @@ http_interactions: | @@ -68,5 +68,5 @@ http_interactions: | ||
68 | OperatorPrimaryRole=' '>\n<HeaderDetails>\n<TableName>InvMaster</TableName>\n<Columns>\n<Column>StockCode</Column>\n</Columns>\n<OrderBy>\n<Column>StockCode</Column>\n</OrderBy>\n</HeaderDetails>\n<Row>\n<StockCode>02</StockCode>\n</Row>\n<RowsReturned> | 68 | OperatorPrimaryRole=' '>\n<HeaderDetails>\n<TableName>InvMaster</TableName>\n<Columns>\n<Column>StockCode</Column>\n</Columns>\n<OrderBy>\n<Column>StockCode</Column>\n</OrderBy>\n</HeaderDetails>\n<Row>\n<StockCode>02</StockCode>\n</Row>\n<RowsReturned> |
69 | \ 1</RowsReturned>\n</InvMaster>\n " | 69 | \ 1</RowsReturned>\n</InvMaster>\n " |
70 | http_version: | 70 | http_version: |
71 | - recorded_at: Fri, 06 Apr 2018 19:23:41 GMT | 71 | + recorded_at: Mon, 14 May 2018 20:17:39 GMT |
72 | recorded_with: VCR 4.0.0 | 72 | recorded_with: VCR 4.0.0 |
test/cassettes/test_sor_query.yml
@@ -27,15 +27,15 @@ http_interactions: | @@ -27,15 +27,15 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Thu, 26 Apr 2018 19:08:08 GMT | 30 | + - Mon, 14 May 2018 20:16:48 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | - string: 'E3333B82C68A4F4893184E2DE8C42E4A00 ' | 33 | + string: 'C525B53B5C1C0F4DA6A5DE07E7FE1D0000 ' |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Thu, 26 Apr 2018 19:08:09 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:16:48 GMT |
36 | - request: | 36 | - request: |
37 | method: get | 37 | method: get |
38 | - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=SORQRY&UserId=E3333B82C68A4F4893184E2DE8C42E4A00%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22SORQRY.XSD%22%3E%0A%20%20%3CKey%3E%0A%20%20%20%20%3CSalesOrder%3E16R069%3C/SalesOrder%3E%0A%20%20%20%20%0A%20%20%3C/Key%3E%0A%20%20%3COption%3E%0A%20%20%20%20%3CIncludeStockedLines%3EN%3C/IncludeStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeNonStockedLines%3EN%3C/IncludeNonStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeFreightLines%3EN%3C/IncludeFreightLines%3E%0A%20%20%20%20%20%20%3CIncludeMiscLines%3EN%3C/IncludeMiscLines%3E%0A%20%20%20%20%20%20%3CIncludeCommentLines%3EN%3C/IncludeCommentLines%3E%0A%20%20%20%20%20%20%3CIncludeCompletedLines%3EN%3C/IncludeCompletedLines%3E%0A%20%20%20%20%20%20%3CIncludeSerials%3EN%3C/IncludeSerials%3E%0A%20%20%20%20%20%20%3CIncludeLots%3EN%3C/IncludeLots%3E%0A%20%20%20%20%20%20%3CIncludeBins%3EN%3C/IncludeBins%3E%0A%20%20%20%20%20%20%3CIncludeAttachedItems%3EN%3C/IncludeAttachedItems%3E%0A%20%20%20%20%20%20%3CIncludeCustomForms%3EN%3C/IncludeCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeDetailLineCustomForms%3EN%3C/IncludeDetailLineCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeValues%3EN%3C/IncludeValues%3E%0A%20%20%20%20%20%20%3CReturnLineShipDate%3EN%3C/ReturnLineShipDate%3E%0A%20%20%20%20%20%20%3CXslStylesheet/%3E%0A%20%20%3C/Option%3E%0A%3C/Query%3E%0A%0A | 38 | + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=SORQRY&UserId=C525B53B5C1C0F4DA6A5DE07E7FE1D0000%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22SORQRY.XSD%22%3E%0A%20%20%3CKey%3E%0A%20%20%20%20%3CSalesOrder%3E16R069%3C/SalesOrder%3E%0A%20%20%20%20%0A%20%20%3C/Key%3E%0A%20%20%3COption%3E%0A%20%20%20%20%3CIncludeStockedLines%3EN%3C/IncludeStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeNonStockedLines%3EN%3C/IncludeNonStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeFreightLines%3EN%3C/IncludeFreightLines%3E%0A%20%20%20%20%20%20%3CIncludeMiscLines%3EN%3C/IncludeMiscLines%3E%0A%20%20%20%20%20%20%3CIncludeCommentLines%3EN%3C/IncludeCommentLines%3E%0A%20%20%20%20%20%20%3CIncludeCompletedLines%3EN%3C/IncludeCompletedLines%3E%0A%20%20%20%20%20%20%3CIncludeSerials%3EN%3C/IncludeSerials%3E%0A%20%20%20%20%20%20%3CIncludeLots%3EN%3C/IncludeLots%3E%0A%20%20%20%20%20%20%3CIncludeBins%3EN%3C/IncludeBins%3E%0A%20%20%20%20%20%20%3CIncludeAttachedItems%3EN%3C/IncludeAttachedItems%3E%0A%20%20%20%20%20%20%3CIncludeCustomForms%3EN%3C/IncludeCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeDetailLineCustomForms%3EN%3C/IncludeDetailLineCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeValues%3EN%3C/IncludeValues%3E%0A%20%20%20%20%20%20%3CReturnLineShipDate%3EN%3C/ReturnLineShipDate%3E%0A%20%20%20%20%20%20%3CXslStylesheet/%3E%0A%20%20%3C/Option%3E%0A%3C/Query%3E%0A%0A |
39 | body: | 39 | body: |
40 | encoding: US-ASCII | 40 | encoding: US-ASCII |
41 | string: '' | 41 | string: '' |
@@ -60,7 +60,7 @@ http_interactions: | @@ -60,7 +60,7 @@ http_interactions: | ||
60 | Server: | 60 | Server: |
61 | - Microsoft-HTTPAPI/2.0 | 61 | - Microsoft-HTTPAPI/2.0 |
62 | Date: | 62 | Date: |
63 | - - Thu, 26 Apr 2018 19:08:15 GMT | 63 | + - Mon, 14 May 2018 20:16:53 GMT |
64 | body: | 64 | body: |
65 | encoding: UTF-8 | 65 | encoding: UTF-8 |
66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<SorDetail Language='05' | 66 | string: "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<SorDetail Language='05' |
@@ -82,5 +82,5 @@ http_interactions: | @@ -82,5 +82,5 @@ http_interactions: | ||
82 | \ 0.000000</ShipGpsLat>\n<ShipGpsLong> 0.000000</ShipGpsLong>\n<ShipComplete>N</ShipComplete>\n<Email/>\n<FixExchangeRate>N</FixExchangeRate>\n<ExchangeRate> | 82 | \ 0.000000</ShipGpsLat>\n<ShipGpsLong> 0.000000</ShipGpsLong>\n<ShipComplete>N</ShipComplete>\n<Email/>\n<FixExchangeRate>N</FixExchangeRate>\n<ExchangeRate> |
83 | \ 1.000000</ExchangeRate>\n<Edited_ExchangeRate>1.000000</Edited_ExchangeRate>\n<MulDiv>M</MulDiv>\n<ConsolidatedOrder/>\n<GstDeduction>I</GstDeduction>\n<CreditedInvDate/>\n<Job/>\n<SerialisedFlag/>\n<CounterSalesFlag/>\n<Nationality/>\n<DeliveryTerms/>\n<ShippingLocation/>\n<TransactionNature>000</TransactionNature>\n<TransportMode>00</TransportMode>\n<ProcessFlag>0</ProcessFlag>\n<JobsExistFlag/>\n<AlternateKey/>\n<HierarchyFlag/>\n<DepositFlag/>\n<EdiSource/>\n<MultShipCode/>\n<CompanyTaxNo/>\n<LastOperator>MATTB</LastOperator>\n<Operator/>\n<State/>\n<CountyZip/>\n<ExtendedTaxCode/>\n<WebCreated/>\n<Quote/>\n<DispatchesMade/>\n<LiveDispExist/>\n<NumDispatches>0</NumDispatches>\n<IncludeInMrp>Y</IncludeInMrp>\n<HeaderText>\n</HeaderText>\n<HeaderNotes>\n</HeaderNotes>\n</SorDetail>\n " | 83 | \ 1.000000</ExchangeRate>\n<Edited_ExchangeRate>1.000000</Edited_ExchangeRate>\n<MulDiv>M</MulDiv>\n<ConsolidatedOrder/>\n<GstDeduction>I</GstDeduction>\n<CreditedInvDate/>\n<Job/>\n<SerialisedFlag/>\n<CounterSalesFlag/>\n<Nationality/>\n<DeliveryTerms/>\n<ShippingLocation/>\n<TransactionNature>000</TransactionNature>\n<TransportMode>00</TransportMode>\n<ProcessFlag>0</ProcessFlag>\n<JobsExistFlag/>\n<AlternateKey/>\n<HierarchyFlag/>\n<DepositFlag/>\n<EdiSource/>\n<MultShipCode/>\n<CompanyTaxNo/>\n<LastOperator>MATTB</LastOperator>\n<Operator/>\n<State/>\n<CountyZip/>\n<ExtendedTaxCode/>\n<WebCreated/>\n<Quote/>\n<DispatchesMade/>\n<LiveDispExist/>\n<NumDispatches>0</NumDispatches>\n<IncludeInMrp>Y</IncludeInMrp>\n<HeaderText>\n</HeaderText>\n<HeaderNotes>\n</HeaderNotes>\n</SorDetail>\n " |
84 | http_version: | 84 | http_version: |
85 | - recorded_at: Thu, 26 Apr 2018 19:08:15 GMT | 85 | + recorded_at: Mon, 14 May 2018 20:16:52 GMT |
86 | recorded_with: VCR 4.0.0 | 86 | recorded_with: VCR 4.0.0 |
test/cassettes/test_successful_logoff.yml
@@ -8,7 +8,7 @@ http_interactions: | @@ -8,7 +8,7 @@ http_interactions: | ||
8 | string: '' | 8 | string: '' |
9 | headers: | 9 | headers: |
10 | User-Agent: | 10 | User-Agent: |
11 | - - Syspro/7 RubyBindings/0.1.0 | 11 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
12 | Content-Type: | 12 | Content-Type: |
13 | - application/x-www-form-urlencoded | 13 | - application/x-www-form-urlencoded |
14 | Accept-Encoding: | 14 | Accept-Encoding: |
@@ -27,21 +27,21 @@ http_interactions: | @@ -27,21 +27,21 @@ http_interactions: | ||
27 | Server: | 27 | Server: |
28 | - Microsoft-HTTPAPI/2.0 | 28 | - Microsoft-HTTPAPI/2.0 |
29 | Date: | 29 | Date: |
30 | - - Fri, 06 Apr 2018 19:22:53 GMT | 30 | + - Mon, 14 May 2018 20:17:59 GMT |
31 | body: | 31 | body: |
32 | encoding: UTF-8 | 32 | encoding: UTF-8 |
33 | - string: '989D81EB0B184A499E7AC2E28724EE9000 ' | 33 | + string: '305EC4843488A34FA16A50494B42BA7C00 ' |
34 | http_version: | 34 | http_version: |
35 | - recorded_at: Fri, 06 Apr 2018 19:22:52 GMT | 35 | + recorded_at: Mon, 14 May 2018 20:17:58 GMT |
36 | - request: | 36 | - request: |
37 | method: get | 37 | method: get |
38 | - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/logoff?UserId=989D81EB0B184A499E7AC2E28724EE9000%20%20 | 38 | + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/logoff?UserId=305EC4843488A34FA16A50494B42BA7C00%20%20 |
39 | body: | 39 | body: |
40 | encoding: US-ASCII | 40 | encoding: US-ASCII |
41 | string: '' | 41 | string: '' |
42 | headers: | 42 | headers: |
43 | User-Agent: | 43 | User-Agent: |
44 | - - Syspro/7 RubyBindings/0.1.0 | 44 | + - Syspro/7 RubyBindings/1.0.0.alpha.1 |
45 | Content-Type: | 45 | Content-Type: |
46 | - application/x-www-form-urlencoded | 46 | - application/x-www-form-urlencoded |
47 | Accept-Encoding: | 47 | Accept-Encoding: |
@@ -60,10 +60,10 @@ http_interactions: | @@ -60,10 +60,10 @@ http_interactions: | ||
60 | Server: | 60 | Server: |
61 | - Microsoft-HTTPAPI/2.0 | 61 | - Microsoft-HTTPAPI/2.0 |
62 | Date: | 62 | Date: |
63 | - - Fri, 06 Apr 2018 19:22:53 GMT | 63 | + - Mon, 14 May 2018 20:17:59 GMT |
64 | body: | 64 | body: |
65 | encoding: UTF-8 | 65 | encoding: UTF-8 |
66 | string: '0' | 66 | string: '0' |
67 | http_version: | 67 | http_version: |
68 | - recorded_at: Fri, 06 Apr 2018 19:22:52 GMT | 68 | + recorded_at: Mon, 14 May 2018 20:17:59 GMT |
69 | recorded_with: VCR 4.0.0 | 69 | recorded_with: VCR 4.0.0 |
test/logon_test.rb
@@ -23,4 +23,15 @@ class LogonTest < Minitest::Test | @@ -23,4 +23,15 @@ class LogonTest < Minitest::Test | ||
23 | ).guid | 23 | ).guid |
24 | ) | 24 | ) |
25 | end | 25 | end |
26 | + | ||
27 | + def test_logon_error | ||
28 | + assert_raises(::Syspro::AuthenticationError) { | ||
29 | + logon_result = ::Syspro::SysproClient.new.logon( | ||
30 | + username, | ||
31 | + 'bad_password', | ||
32 | + company, | ||
33 | + company_password | ||
34 | + ) | ||
35 | + } | ||
36 | + end | ||
26 | end | 37 | end |