consuming and producing web services using openedge 10.1

32

Upload: hastin

Post on 19-Mar-2016

100 views

Category:

Documents


3 download

DESCRIPTION

Consuming and Producing Web Services using OpenEdge 10.1. Agenda. Web Services Overview Consuming External Web Service Producing ABL Web Service State Free Web Service for State Aware App Stock Distribution Application Demo. Agenda. Web Services Overview Consuming External Web Service - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Consuming and Producing Web Services using  OpenEdge 10.1
Page 2: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services Overview Consuming External Web Service Producing ABL Web Service State Free Web Service for State Aware App Stock Distribution Application Demo

Page 3: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services Overview Consuming External Web Service Producing ABL Web Service State Free Web Service for State Aware App Stock Distribution Application Demo

Page 4: Consuming and Producing Web Services using  OpenEdge 10.1

A Web Service is a software system identified by a URI, whose public interfaces and bindings are defined and described by XML. Its definition can be discovered by other software systems. These systems may then interact with the Web Service in a manner prescribed by its definition, using XML based messages conveyed by internet protocols

Web Services ArchitectureW3C Working Draft 14 November 2002http://www.w3.org/TR/ws-arch/

Page 5: Consuming and Producing Web Services using  OpenEdge 10.1

An application that can be accessed over the Web or any network from another application using RPC style calls encoded using SOAP over HTTP where the interface is described using WSDL

Ken Wilner, Fellow PSC

Reality today

Page 6: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services◦ A set of standards that comprise a platform for

building distributed, interoperable applications OpenEdge Web Services utilizes W3C

standards◦ WSDL 1.1 (W3C Note – de facto standard)◦ SOAP 1.1 HTTP Binding◦ 2001 XML Schema

W3C = World Wide Web Consortium, http://www.w3.org/

Page 7: Consuming and Producing Web Services using  OpenEdge 10.1

A lightweight xml-based protocol for message exchange

Supports message typing, strong typing, and structured data

Can be used in a variety of communication paradigms

Programming language and platform independent Highly extensible

◦ Transport independent◦ Encoding independent◦ Extra context via headers

Simple Object Access Protocol

Page 8: Consuming and Producing Web Services using  OpenEdge 10.1

Specifies interface, and network address◦ Service interface maps to business interface◦ Business methods (operations) that can be invoked ◦ Message structure for each method

Data fields, types◦ Bindings for the operations

SOAP over HTTP Generation approaches

◦ WSDL generated from business interface◦ Business interface generated from WSDL

Web Service Description Language

Page 9: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services Overview Consuming External Web Service Producing ABL Web Service State Free Web Service for State Aware App Stock Distribution Application Demo

Page 10: Consuming and Producing Web Services using  OpenEdge 10.1

Obtain contract from Web service provider◦ i.e. WSDL and any documentation

Run the WSDL Analyzer over WSDL◦ Generates HTML information including ABL code

snippet examples Use WSDL Analyzer information to code

calls to Web service Call the Web service

Page 11: Consuming and Producing Web Services using  OpenEdge 10.1

Input WSDL (obtained from service provider)

Output HTML documentation ◦ ABL code snippets and examples◦ SOAP/XML samples◦ Textual information about service

proenv>bprowsdldoc C:\temp\MyService.wsdl orproenv>bprowsdldoc http://server/wsa/....

Page 12: Consuming and Producing Web Services using  OpenEdge 10.1

Initial connection is made◦ WSDL obtained◦ Client holds local port◦ Physical connection only when calling an

operation

CREATE SERVER hWebService.hWebService:CONNECT("-WSDL 'http://localhost:8080/wsa/wsa1/wsdl?targetURI=urn:wsProvider:Emp'").

Page 13: Consuming and Producing Web Services using  OpenEdge 10.1

DEFINE VARIABLE hWebService AS HANDLE.DEFINE VARIABLE hPortType AS HANDLE.

CREATE SERVER hWebService.

hWebService:CONNECT( wsdl url ).

RUN portTypeName SET hPortType ON SERVER hWebService.

RUN operationName(…) in hPortType.

DELETE PROCEDURE hPortType.hWebService:DISCONNECT().DELETE OBJECT hWebService.

Page 14: Consuming and Producing Web Services using  OpenEdge 10.1

FUNCTION DynDeptEmp RETURNS CHARACTER (INPUT pcDeptName AS CHARACTER, OUTPUT TABLE-HANDLE hDeptEmp) IN hPortType.

result = DynDeptEmp(pcDeptName, TABLE-HANDLE hDeptEmp).

RUN DynDeptEmp IN hPortType (INPUT pcDeptName, OUTPUT result, OUTPUT TABLE-HANDLE hDeptEmp).

Page 15: Consuming and Producing Web Services using  OpenEdge 10.1

RUN operationName IN hPortType (INPUT value1, OUTPUT value2) NO-ERROR.

IF ERROR-STATUS:ERROR THEN DO: DO iCnt = 1 TO ERROR-STATUS:NUM-MESSAGES: MESSAGE ERROR-STATUS:GET-MESSAGE(iCnt) VIEW-AS ALERT-BOX. END.

IF VALID-HANDLE(ERROR-STATUS:ERROR-OBJECT-DETAIL) THEN DO: MESSAGE "Fault Code:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-CODE SKIP "Fault Actor:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-ACTOR SKIP "Fault String:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-STRING

VIEW-AS ALERT-BOX.

IF VALID-HANDLE(ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAIL) THEN MESSAGE "Fault Detail:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAIL:GET-SERIALIZED()

VIEW-AS ALERT-BOX. END. END.

Page 16: Consuming and Producing Web Services using  OpenEdge 10.1

bprowsdldoc ABL example SOAP Faults

Page 17: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services Overview Consuming External Web Service Producing ABL Web Service State Free Web Service for State Aware App Stock Distribution Application Demo

Page 18: Consuming and Producing Web Services using  OpenEdge 10.1
Page 19: Consuming and Producing Web Services using  OpenEdge 10.1

DevelopAppServerapplication

Design Web service

Generate Web service

definition

Dev

elop

Page 20: Consuming and Producing Web Services using  OpenEdge 10.1

DevelopAppServerapplication

Design Web service Install/

Configure the WSA

Deploy Web service

to WSA

Configure and Enable Web

service

Generate Web service

definition

Dev

elop

Dep

loy/

Adm

in

Page 21: Consuming and Producing Web Services using  OpenEdge 10.1

DevelopAppServerapplication

Design Web service Install/

Configure the WSA

Deploy Web service

to WSA

Configure and Enable Web

service

DevelopTest Client Application

Re-configure Web Service

Generate Web service

definition

Dev

elop

Dep

loy/

Adm

in

Adm

in

Page 22: Consuming and Producing Web Services using  OpenEdge 10.1

Tomcat WSA State Free Application Server Simple Login Web Service Generate service definition (WSM) Deploy and enable Web Service Test Web Service

Page 23: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services Overview Consuming External Web Service Producing ABL Web Service State Free Web Service for State Aware App Stock Distribution Application Demo

Page 24: Consuming and Producing Web Services using  OpenEdge 10.1

State Aware Application: Start session Connect DB to session Identify user Instantiate Session State

◦ Start support procedures◦ Set session variables◦ etc

User remains connected

State Free Web Service State Free Web Service for State Aware for State Aware ApplicationApplication

Time consuming expensive operations

Page 25: Consuming and Producing Web Services using  OpenEdge 10.1

State Free Web Service: Start State Free agents when broker starts Connect DB to App Server at startup Start support procedures Identify user as separate Web Service call

◦ Issue Session ID and save in DB◦ Save as much session state as needed with the Session ID

For each subsequent API, re-instantiate session state based on Session ID

Page 26: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services Overview Consuming External Web Service Producing ABL Web Service State Free Web Service for State Aware App Stock Distribution Application Demo

Page 27: Consuming and Producing Web Services using  OpenEdge 10.1

Web Services Produced Product Catalogue Purchase Orders PO Receipting Sales Orders Sales Order Dispatched Stock Adjustment

Web Services Consumed PO Received Delivery Notification Dispatch Notification PO Receipt Notification

Page 28: Consuming and Producing Web Services using  OpenEdge 10.1

UNIBIS is a Financial, Distribution, Service and Manufacturing application developed over 15 years with Progress Technology, and supported by a small dynamic team out of the ComOps Melbourne Office.

Our objectives are to provide solutions that allow our customers to capture data without traditional data entry. Volume and efficiency through data collaboration.

Web Services are part of the strategy of using the UNIBIS ERP as a data repository . Specific processing that can easily sit on top of what are standard ERP business outcomes.

Page 29: Consuming and Producing Web Services using  OpenEdge 10.1
Page 30: Consuming and Producing Web Services using  OpenEdge 10.1
Page 31: Consuming and Producing Web Services using  OpenEdge 10.1

Web Service Login to retrieve session ID Using Excel to call ABL Web Service

Page 32: Consuming and Producing Web Services using  OpenEdge 10.1

Robin Smith