from the Progress 4GL

tunisianhomeΛογισμικό & κατασκευή λογ/κού

17 Φεβ 2014 (πριν από 3 χρόνια και 5 μήνες)

143 εμφανίσεις

Call Any Web Service
from the Progress 4GL

Michael Resnick

Principal Software Engineer


2

© 2005 Progress Software Corporation

D I S C L A I M E R

Under Development


This talk includes information about potential
future products and/or product enhancements.


What I am going to say reflects our current
thinking, but the information contained herein
is preliminary and subject to change. Any
future products we ultimately deliver may be
materially different from what is described
here.

D I S C L A I M E R

3

© 2005 Progress Software Corporation


Introduction


Web Service Basics


WSDL Analyzer


Calling A Web Service from the 4GL


Coming in 10.1A And Beyond

Agenda

4

© 2005 Progress Software Corporation

Web Service Client


Available in OpenEdge
®

10.0A


AppServer not needed


Client to a different application

5

© 2005 Progress Software Corporation

Web Services


Why?


Heterogeneous connectivity


In SOA makes distributed services
possible


Lower common denominator than either
EDI or CORBA


6

© 2005 Progress Software Corporation

Web Services


Why?


Web service providers available


Products: OpenEdge, Oracle, IBM DB/2,
SalesForce.com, etc.


Services: Google, e
-
Bay, Commonwealth of
Massachusetts, etc.


Development platforms: OpenEdge,
.NET

, J2EE, Apache, WebSphere.

7

© 2005 Progress Software Corporation

Web Services


Why Not?


May not be efficient


May not be available

8

© 2005 Progress Software Corporation

Web Service Basics
-

Where?


Users


Presentation Layer

Business Servicing Layer

Data Access Layer

Managed

Data Stores

Unmanaged

Data Stores


Enterprise

Services


Integration Layer

Environment Managers and Utilities

9

© 2005 Progress Software Corporation


Introduction


Web Service Basics


WSDL Analyzer


Calling A Web Service from the 4GL


Coming in 10.1A And Beyond

Agenda

10

© 2005 Progress Software Corporation

Web Service Basics


SOAP Message

Envelope

Body

Header

Header Entry



Body Entry

Body Entry

Header Entry



Entries may be
SOAP Faults
(errors)

Header optional

S

imple

O

bject

A

ccess

P

rotocol


11

© 2005 Progress Software Corporation

Web Service Basics
-

WSDL

Defines


Interface


Data encoding


Transport


Service address

Contract between client and server

W

eb

S

ervice

D

escription

L

anguage

12

© 2005 Progress Software Corporation

Anatomy of a Web Service Session

OpenEdge
4GL Client



A Web
Service
Provider



SOAP Request

SOAP Response

SOAP Request

SOAP Response

WSDL Request

WSDL Response

13

© 2005 Progress Software Corporation


Introduction


Web Service Basics


WSDL Analyzer


Introduction


Analyzer demonstration


Calling A Web Service from the 4GL


Coming in 10.1A And Beyond


Agenda

14

© 2005 Progress Software Corporation

4GL/WSDL Dictionary


4GL




WSDL


AppServer

.…......…............. Web service


Persistent procedure..............Port type (interface)


Internal procedure..................Operation

15

© 2005 Progress Software Corporation

WSDL Analyzer Command Line

Generates 4GL documentation for a web service




C:
\
temp> bprowsdldoc

http://api.google.com/GoogleSearch.wsdl

google


Documentation written to

file:///c:
\
temp
\
google
\
index.html


C:
\
temp>

16

© 2005 Progress Software Corporation

Anatomy of Client Design

WSDL
Analyzer

Web Service
Provider

WSDL Request

WSDL Response

Generated
Documents

OpenEdge
4GL Client

17

© 2005 Progress Software Corporation

Generated Documents

Data types


complex data

Operation
Index

Port type


connect

& call

Service


index

18

© 2005 Progress Software Corporation

Analyzer Demo Snapshots:

Service Documentation

19

© 2005 Progress Software Corporation

Analyzer Demo Snapshots:

Service Document

20

© 2005 Progress Software Corporation

Analyzer Demo Snapshots:

Port Type


Connection Summary

21

© 2005 Progress Software Corporation

Analyzer Demo Snapshots:

Port Type


Operation Summary

22

© 2005 Progress Software Corporation

Analyzer Demo Snapshots:

Port Type


Operation Example

23

© 2005 Progress Software Corporation

Analyzer Demo Snapshots:

Port Type


Operation Parameters

24

© 2005 Progress Software Corporation

Analyzer Demo Snapshots:

Port Type


Complex Parameter Example

25

© 2005 Progress Software Corporation

Complex Data as TEMP
-
TABLE

addCustomers


Procedure prototype

PROCEDURE addCustomers:


DEFINE INPUT PARAMETER TABLE FOR customerList.


DEFINE OUTPUT PARAMETER TABLE FOR conflictList.

END PROCEDURE.



26

© 2005 Progress Software Corporation

Complex Data as TEMP
-
TABLE

Example

DEFINE TEMP
-
TABLE customerList


NAMESPACE
-
URI


http://mycompany.com/schemas/customerList


NAMESPACE
-
PREFIX "cust“


FIELD CustNum AS INTEGER


FIELD Name AS CHARACTER


XML
-
NODE
-
TYPE "Attribute“


FIELD Country AS CHARACTER


FIELD Comments AS CHARACTER


INDEX CustNum IS PRIMARY UNIQUE CustNum


INDEX Name Name


INDEX Comments IS WORD
-
INDEX Comments.


27

© 2005 Progress Software Corporation

Complex Data as TEMP
-
TABLE

Parameters

customerList


This value is defined as a TEMP
-
TABLE.


This value can also be expressed as a
CustomerTable

element in

The http://mycompany.com/schemas/customerList

namespace. As such, this parameter can be passed as a

CHARACTER or LONGCHAR value containing an XML

document.
View example of XML
.

28

© 2005 Progress Software Corporation


Introduction


Web Service Basics


WSDL Analyzer


Calling A Web Service from the 4GL


Data type mapping


Connecting and calling


Demonstration


Header handling


Error handling


Coming in 10.1A And Beyond


Agenda

29

© 2005 Progress Software Corporation

Simple Data Type Map

XML Schema Data Type

Progress 4GL Data Type

string

CHARACTER

boolean

LOGICAL

decimal

DECIMAL

integer

INTEGER

float, double, duration

CHARACTER

CHARACTER and LONGCHAR can
always

be used

For complete mappings see documentation

30

© 2005 Progress Software Corporation

Complex Data

Represented two ways:

1.
LONGCHAR/CHARACTER of serialized
XML document

2.
ProDataSet or TEMP
-
TABLE when
possible (10.1A)


Analyzer shows examples for each.

31

© 2005 Progress Software Corporation

CREATE SERVER
app
-
server
-
handle
.

app
-
server
-
handle
:CONNECT(“
appserver
-
connect
-
parms
”).

RUN
persistent
-
proc

PERSISTENT SET
procedure
-
handle



ON
app
-
server
-
handle
.

RUN
internal
-
proc

IN
procedure
-
handle
(
parameters
).

CREATE SERVER
web
-
svc
-
handle
.

web
-
svc
-
handle
:CONNECT(“
-
WSDL
wsdl
-
url ws
-
connect
-
parms
”).

RUN
port
-
type
-
name

SET
port
-
type
-
handle

ON
web
-
svc
-
handle
.

RUN
operation

IN
port
-
type
-
handle
(
parameters
).

Connecting and Calling

Just Like An AppServer

32

© 2005 Progress Software Corporation

Google Results in Browser

33

© 2005 Progress Software Corporation

Selected Connection Example

34

© 2005 Progress Software Corporation

Pasted Connection and Call
Examples

35

© 2005 Progress Software Corporation

Variable Definitions in Completed .p

36

© 2005 Progress Software Corporation

Connect and Set Port in Completed .p

37

© 2005 Progress Software Corporation

Call to Google in Completed .p

38

© 2005 Progress Software Corporation

Search Results Using DOM

39

© 2005 Progress Software Corporation

Load TEMP
-
TABLE with Results

40

© 2005 Progress Software Corporation

4GL Client Results

41

© 2005 Progress Software Corporation

4GL SOAP Header Objects

Envelope

Body

Header

Header Entry



Body Entry

Header Entry

SOAP
-
HEADER

SOAP
-
HEADER
-
ENTRYREF



SOAP
-
HEADER
-
ENTRYREF

42

© 2005 Progress Software Corporation

SOAP Headers


Set a callback

port
-
type
-
handle
:SET
-
CALLBACK
-
PROCEDURE(


“REQUEST
-
HEADER | RESPONSE
-
HEADER”,




request
-
handler
-
name
”,



web
-
service
-
handle
).


Write the callback

PROCEDURE
request
-
handler
-
name
:


DEFINE INPUT PARAMETER
soap
-
header
-
handle

AS


HANDLE.


DEFINE INPUT PARAMETER
operation
-
namespace

AS


CHARACTER.


DEFINE INPUT PARAMETER
operation
-
local
-
name

AS


CHARACTER.

END.

43

© 2005 Progress Software Corporation

Anatomy Of A Web Service Error

OpenEdge
4GL Client



Web Service
Provider



SOAP Request

SOAP Response

(FAULT)

WSDL Request

WSDL Response

44

© 2005 Progress Software Corporation

4GL SOAP Fault

Envelope

Body

Body Entry

fault code

fault string

fault actor

<faultdetail>

45

© 2005 Progress Software Corporation

4GL Fault Objects

ERROR
-
STATUS

SOAP
-
FAULT

SOAP
-
FAULT
-
DETAIL

XML

fault info

46

© 2005 Progress Software Corporation

SOAP Fault
-

Faultstring


An error was detected while
executing the Web Service request.
(10893)

47

© 2005 Progress Software Corporation

SOAP Fault
-

Detail

<detail>


<errorMessage>


msg=The server application returned the


error: Invoice not found;


targetException=ERROR condition: The Server


application has returned an error.


(7243) (7211)]


</errorMessage>


<requestID>


172247e5b58beb30:5bb966:fb4fdb744a:
-
7fff#9


</requestID>

</detail>

48

© 2005 Progress Software Corporation


Introduction


Web Service Basics


WSDL Analyzer


Calling A Web Service from the 4GL


Coming in 10.1A And Beyond

Agenda

49

© 2005 Progress Software Corporation

Coming in OpenEdge 10.1A


Mapping complex data to ProDataSets and
TEMP
-
TABLEs


Support for wrapped document literal


Improvements in the WSDL Analyzer


Facet documentation


Reserved keywords

50

© 2005 Progress Software Corporation

Beyond 10.1A

We are considering


Improving complex data support based
on OO initiative


SOAP 1.2, WSDL 2.0 Support


Integration with new OpenEdge IDE


Improved validation


WS
-
Security


51

© 2005 Progress Software Corporation

In Summary


Calling a web service is easy


Use the WSDL Analyzer

OpenEdge 4GL
Client

Web Service
or
AppServer?


52

© 2005 Progress Software Corporation

SOAP 1.1 Specification


SOAP 1.1


Notes (submissions by member
organizations)


Simple Object Access Protocol (SOAP) 1.1

http://www.w3.org/TR/SOAP


53

© 2005 Progress Software Corporation

SOAP 1.2 Specifications (1/4)


SOAP 1.2


Recommendations (standards)


Base


SOAP Version 1.2 Part 0: Primer

http://www.w3.org/TR/soap12
-
part0/


SOAP Version 1.2 Part 1: Messaging
Framework

http://www.w3.org/TR/soap12
-
part1/


SOAP Version 1.2 Part 2: Adjuncts

http://www.w3.org/TR/soap12
-
part2/


SOAP Version 1.2 Specification Assertions
and Test Collection

http://www.w3.org/TR/soap12
-
testcollection

54

© 2005 Progress Software Corporation

SOAP 1.2 Specifications (2/4)


SOAP 1.2


Recommendations (standards)


Ancillary


SOAP Message Transmission Optimization
Mechanism

http://www.w3.org/TR/soap12
-
mtom/



Resource Representation SOAP Header
Block

http://www.w3.org/TR/soap12
-
rep/


55

© 2005 Progress Software Corporation

SOAP 1.2 Specifications (3/4)


SOAP 1.2


Drafts (submitted by W3C working groups;
will become recommendations)


SOAP 1.2 Attachment Feature

http://www.w3.org/TR/soap12
-
af/



SOAP Version 1.2 Message Normalization

http://www.w3.org/TR/soap12
-
n11n/


SOAP Optimized Serialization Use Cases
and Requirements

http://www.w3.org/TR/soap12
-
os
-
ucr/

56

© 2005 Progress Software Corporation

SOAP 1.2 Specifications (4/4)


SOAP 1.2


Notes (submitted by W3C working groups
or member organizations)


SOAP Version 1.2 Usage Scenarios

http://www.w3.org/TR/xmlp
-
scenarios



SOAP Version 1.2 Email Binding

http://www.w3.org/TR/soap12
-
email

57

© 2005 Progress Software Corporation

WSDL 1.1 Specification


WSDL 1.1


Notes (submitted by member
organizations)


Web Services Description Language
(WSDL) 1.1

http://www.w3.org/TR/wsdl

58

© 2005 Progress Software Corporation

WSDL 2.0 Specifications


WSDL 2.0


Drafts (submitted by W3C working group; will become
standards)


Web Services Description Language (WSDL) Version
2.0 Part 0: Primer

http://www.w3.org/TR/wsdl20
-
primer


Web Services Description Language (WSDL) Version
2.0 Part 1: Core Language

http://www.w3.org/TR/wsdl20


Web Services Description Language (WSDL) Version
2.0 Part 3: Bindings

http://www.w3.org/TR/wsdl20
-
bindings


Web Services Description Language (WSDL) Version
2.0 Part 2: Predefined Extensions

http://www.w3.org/TR/wsdl20
-
extensions

59

© 2005 Progress Software Corporation

Google Web Service Site


Google Web APIs (beta)

http://www.google.com/apis

60

© 2005 Progress Software Corporation

Questions?

61

© 2005 Progress Software Corporation

Thank you for
your time!

62

© 2005 Progress Software Corporation