Demo: Consuming Web Services from Plexplex2e.com/downloads/12A - Consuming web services...

Preview:

Citation preview

Consuming Web Services using CA Plex

12A

Juan Rios

Rollins Corporation

Web Service strategy

rWebAPI Pattern

> Supports interfacing with the Web

> Provides the classes to call Web services (REST)

> Supports displaying web content in client functions

> Supports tracing and logging errors and information

rWebAPI Pattern Structure

> Components Abstract

Data

Messages

Scripts

Services

UI

rWebAPI.Data Structure

> Contains the entities that handle the information about the web services and pages:

> WebPage

> WebServer

> WebService

> WebService.Log

> WebService.ReturnedStatus

> WebService.Scope

> WebService.System

rWebAPI.Samples Structure

> Contains the sample code for easier understanding of the pattern

rWebAPI.Data Structure

> WebService is known by WebServiceId

> WebService Refers to WebPage for WebPageId

> WebService Refers to WebServer for WebServerId

rWebAPI.Data.Webservice Structure

> WebService Refers to WebService.System

> WebService Refers to WebService.Scope

> WebService.Log Owned by WebService.System

> WebService.Log Refers to WebService

> WebService.Log Refers to WebService.Scope

> WebService.ReturnedStatus Owned by WebServerId

rWebAPI.Abstract Structure

> This area is where all the abstract classes reside

> These classes contain the actual functionality for which the pattern is designed

Web S

ervices ClassesW

eb C

onte

nt C

lass

es

ROLLINS FOUNDATION CLASSES

rWebAPI FOUNDATION CLASSES

rWebAPI IMPLEMENTABLE CLASSES

rWebAPI IMPLEMENTED CLASSES

rWebAPI SCRIPTS

rWebAPI.Abstract Class

rWebAPI.Abstract Class Structure

rWebAPI.Abstract Class Structure

Web

Con

tent

Cla

sses

Web S

ervices Classes

rWebAPI.Abstract Class Structure

ROLLINS FOUNDATION CLASSES

rWebAPI FOUNDATION CLASSES

rWebAPI IMPLEMENTABLE CLASSES

rWebAPI IMPLEMENTED CLASSES

rWebAPI SCRIPTS

ROLLINS Foundation Classes

> Rollins’ specialization of the Plex Classes

RUIBasicShell

RFrameChild

RFunctionShell

> They do not belong to the rWebAPI pattern

rWebAPI Foundation Classes

> Classes that provide the foundation for rWebAPI patterns for web services and web content display: Browser

WebWrapper

Browser Class

> Provide foundation for web content support

> Displays a Web Browser withbasic functionaliy:

Load

Refresh

Stop

Close

WebWrapper Class

> Provides foundation structure to call web services

> Defines the input parameters for web services

> Obtains Web service information

> Builds complete URL

rWebAPI Implementable Classes

> WindowBrowser

> FrameBrowser

> FrameBrowser.FramWebPage

> WebPageFrame

> WebPageStandard

> WebPageCustom

> Classes that provide the necessary functionality to display web content and call web services. These are the classes that the developers will inherit from

> WebPageCustom.BrowserWindow

> WebService

> WinCWebService

> RPGWebService

> WebInvoke

WindowBrowser Class

> Adds WebPageURL field as Input parameter to support calls from other functions

> Uses provided subroutine to load web content.

> Do not inherit from this object directly since there are other classes that provide more specialized behavior

WebPageFrame Class

> Adds WebPageURL as an output parameter

> Returns WebPageURL after URL has been constructed

> Do not inherit from this object directly since there are other classes that provide more specialized behavior

WebPageStandard Class

> Adds Call to Implemented Class DisplayWindowBrowser

> Inherit from this function when web page to display will not be combined with other controls (i.e. grids, fields, etc)

RWebAPI.Samples.WebContent.WCStandard

WebPageCustom Class

> Supports web content display along side other controls

> Inherit from this class when customization is needed in the panel where web content is displayed in a separate window

RWebAPI.Samples.WebContent.WebCCustom.WCCustom

.BrowserWindow Class

> Class scoped by WebPageCustom Class

> Display the web content in a customizable panel by the implementer

> Will be inherited implicitly when scoping class is inherited

RWebAPI.Samples.WebContent.WebCCustom.WCCustom.BrowserWindow

FrameBrowser Class

> Supports web content displayed along side other controls within a frame panel

> This Class will call FrameWebPage to construct URL before loading web content

> Inherit from this class when customization is needed in the panel where web content is displayed in a separate window.

.FrameWebPage Class

> Class scoped by FrameBrowser Class

> Adds WebPageURL as an output parameter

> Returns WebPageURL after URL has been constructed

WebService Class

> Foundation class for Web Services wrapping

> Adds Dual Field WSRowsFetched in the Control input variable for determining how many records have been populated in the FetchedData variable

> Adds returning message and status as output as well as defines FetchedData

> Adds parsing of resulting data into the FetchedData variable

> Calls WebInvoke for actual calling of web service

> Do not inherit from this class since there are specialized subclasses bases upon implementation language

WebInvoke Class

> Foundation class for Web Services invocation

> Calls source code/api to do actual call to the web service

> Returns raw resulting data back to calling class

> Do not inherit from this class since there are specialized subclasses bases upon implementation language

WinCWebService RPGWebService

> Implementable class for Web Services wrapping

> Implementation language added

> Replaces Calls to WebInvoke for actual implementable subclasses for calling of web service

> Inherit from this class when implementing web services.

> To implement this class:

> Add fields to the Input variable for the input parameters for the web service

> Add the output fields to the FetchedData variable. These fields are the output of the web service. They should be in the same order as in the WS Signature

> Change occurrences for FetchedData variable if MOV

> Add line to determine WebServiceId to call in the AD

> Change Implement SYS triplet to YES

RWebAPI.Samples.WebService.SOV.WinC.AddressVerificationWS

rWebAPI Implemented Classes

> Objects that are implemented

> They perform the actual work of the rWebAPI pattern

DisplayWindowBrowser

> This function display the web content in a dialog window

> This function is called by other functions when displaying web content is the only functionality needed in the panel

> This function is implemented; therefore, the only work the developer needs to do is to call it using the implementable classes provided in the pattern

WinCWebServiceInvokeRPGWebServiceInvoke

> These functions invoke the webservice

> These functions are called by other functions when calling web services

> These functions are implemented; therefore, the only work the developer needs to do is to call them using the implementable classes provided in the pattern

rWebAPI Scripts

> Low level objects that are used by the pattern to call web services

> Do not inherit from these objects

Logging

Error Handling

Web Service Interface(RWebAPI.Abstract.WebService)

HTTP CALL

Web Service Provider

5

4

3

FUNCTION CALL

Web Service Consumer(RWebAPI.Abstract.WebServiceConsumer)

1

2

Step Description Error Variable on (1)

Field on (1)

2 Function Call Failure to find Function

Environment <*Call Status>

3 Web Service Interface

Failure to find Web Service information

Environment

<*Returned Status>

Failure to Invoke Web Service

Environment

<*Returned Status>

Failure to insert Logging information

Environment

<*Returned Status>

4 HTTP Call HTTP Related Failures

WebServiceL WSHTTPReturnedStatus WebServiceL WSHTTPStatusType

5 Web Service Provider

Web Service Related Failures

WebServiceL WSReturnedStatus WebServiceL WSStatusType WebServiceL WSReturnedMessage

Demo and Q&A

Recommended