forked from consultingwerk/CCS_Samples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinvoke-custom-service.p
80 lines (59 loc) · 2.66 KB
/
invoke-custom-service.p
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**********************************************************************
* Copyright (C) 2006-2016 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.de and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**********************************************************************/
/*------------------------------------------------------------------------
File : invoke-custom-service.p
Purpose :
Syntax :
Description :
Author(s) :
Created : Wed Jun 22 11:21:32 CEST 2016
Notes :
----------------------------------------------------------------------*/
/* *************************** Definitions ************************** */
BLOCK-LEVEL ON ERROR UNDO, THROW.
USING Ccs.Common.* FROM PROPATH.
USING Consultingwerk.CcsSamples.CustomService.* FROM PROPATH.
DEFINE VARIABLE oMatchesService AS IEuro2016ResultService NO-UNDO .
DEFINE VARIABLE i AS INTEGER NO-UNDO .
DEFINE VARIABLE oResults AS MatchResult EXTENT .
/* *************************** Main Block *************************** */
RUN Consultingwerk/CcsSamples/boot.p .
oMatchesService = CAST (Application:ServiceManager:getService(GET-CLASS (IEuro2016ResultService)),
IEuro2016ResultService) .
oResults = oMatchesService:GetTodaysMatchResults().
// oResults = oMatchesService:GetMatchResultsByTeam(TeamEnum:Germany) .
MESSAGE "today:" EXTENT (oResults)
VIEW-AS ALERT-BOX.
DO i = 1 TO EXTENT (oResults):
MESSAGE oResults[i]:ToString()
VIEW-AS ALERT-BOX.
END.
EXTENT (oResults) = ? .
oResults = oMatchesService:GetMatchResultsByDate(7/10/2016).
MESSAGE "final (7/10/2016):" EXTENT (oResults)
VIEW-AS ALERT-BOX.
DO i = 1 TO EXTENT (oResults):
MESSAGE oResults[i]:ToString()
VIEW-AS ALERT-BOX.
END.
// Error handling
CATCH apperr AS Progress.Lang.AppError :
MESSAGE apperr:GetMessage(1) SKIP
apperr:ReturnValue SKIP (2)
apperr:CallStack
VIEW-AS ALERT-BOX.
END CATCH.
CATCH err AS Progress.Lang.Error :
MESSAGE err:GetMessage(1) SKIP (2)
err:CallStack
VIEW-AS ALERT-BOX.
END CATCH.