SOA-12: Integrate over the Web with OpenEdge® Web Services David Lund Sr. Training Program Manager.

51
SOA-12: Integrate over the Web with OpenEdge® Web Services David Lund Sr. Training Program Manager

Transcript of SOA-12: Integrate over the Web with OpenEdge® Web Services David Lund Sr. Training Program Manager.

SOA-12: Integrate over the Web with OpenEdge® Web Services

David Lund

Sr. Training Program Manager

© 2006 Progress Software Corporation2SOA-12: Integrate over the Web with OpenEdge Web Services

Session Focus

Understanding Web Services

Identify when to use Web Services

Implementing an OpenEdge service provider

Implementing an OpenEdge service consumer

Implementing OpenEdge Web Services

© 2006 Progress Software Corporation3SOA-12: Integrate over the Web with OpenEdge Web Services

Agenda

The Value of Web Services

OpenEdge Web Service Provider

ABL Client as a Consumer

Integrate over the Web with OpenEdge Web Services

This presentation use the abbreviation ABL for OpenEdge Advanced Business Language (formerly known as OpenEdge 4GL)

© 2006 Progress Software Corporation4SOA-12: Integrate over the Web with OpenEdge Web Services

The Value of Web Services

Why to use Web Services• Heterogeneous connectivity

• In SOA makes distributed services possible

• Lower common denominator than either EDI or CORBA

• Many Services are available

Why not to use Web Services• May not be efficient enough

• May not be available

© 2006 Progress Software Corporation5SOA-12: Integrate over the Web with OpenEdge Web Services

Consumers and Providers

Web Service Provider Developer• Develops and deploys the Web service• Publishes the WSDL

Web Service Consumer Developer• Writes code to access deployed services based on the

WSDL contract

Web service

provider

Web service

consumer

Client

Web service

Standards

© 2006 Progress Software Corporation6SOA-12: Integrate over the Web with OpenEdge Web Services

Web Services is Defined by Standards

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/

© 2006 Progress Software Corporation7SOA-12: Integrate over the Web with OpenEdge Web Services

Standards: WSDL

Specifies the interface• Bindings for the operations

– SOAP over HTTP

• Business methods that can be invoked (“operations”)

• Message structure for each method– Data fields, types

Identifies network address of Web service

Web Services Description Language

Contract between provider and consumer

© 2006 Progress Software Corporation8SOA-12: Integrate over the Web with OpenEdge Web Services

Standards: SOAP

Protocol for message exchange• Lightweight & XML-based

Independent of encoding, transport, language, and platform

Extensible via SOAP headers

Supports message typing, strong typing, and structured data

© 2006 Progress Software Corporation9SOA-12: Integrate over the Web with OpenEdge Web Services

Standards: XML Schema

Comprise of a set of agreed upon rules • Structure, Content, and Semantics

A means for defining XML Documents• Used to define formats for SOAP and WSDL

messages

Maps ABL data types

© 2006 Progress Software Corporation10SOA-12: Integrate over the Web with OpenEdge Web Services

Agenda

The Value of Web Services

OpenEdge Web Service Provider

ABL Client as a Consumer

Integrate over the Web with OpenEdge Web Services

© 2006 Progress Software Corporation11SOA-12: Integrate over the Web with OpenEdge Web Services

OpenEdge Web Service Provider

Your Application• Broken down into services

Application Server• Hosts Application code exposed as services

• Provides database access

ProxyGen• Generate interface file used for deployment

Progress Explorer or wsaman• Manage Web service (deployment)

Required Components

© 2006 Progress Software Corporation12SOA-12: Integrate over the Web with OpenEdge Web Services

OpenEdge Web Service Provider

3rd Party Products• Web Server

– Provides HTTP support– Host JSE

• Java Servlet Engine (JSE)– Provides environment to run WSA servlet

WSA Servlet • Interface between the Web Server and the OpenEdge

AppServer

Required Components

WSA = Web Services Adapter

© 2006 Progress Software Corporation13SOA-12: Integrate over the Web with OpenEdge Web Services

Deploying a OpenEdge Web Service

ProxyGen WSM

OpenEdge AppServer

OpenEdge Application

Business Logic

r-code

2

1

Intermediate file used for Web service deployment

© 2006 Progress Software Corporation14SOA-12: Integrate over the Web with OpenEdge Web Services

Deploying a OpenEdge Web Service

Progress Explorer or

wsaman

ProxyGen WSM

OpenEdge AppServer

OpenEdge Application

Business Logic

r-code

2

1

3

WSDL WSAD

Intermediate file used for Web service deployment

© 2006 Progress Software Corporation15SOA-12: Integrate over the Web with OpenEdge Web Services

Deploying a OpenEdge Web Service

ProxyGen WSM

OpenEdge AppServer

OpenEdge Application

Business Logic

r-code

2

1

Web Server

WSA Servlet

Java Servlet Engine

4

WSDL WSAD

3

Progress Explorer or

wsaman

© 2006 Progress Software Corporation16SOA-12: Integrate over the Web with OpenEdge Web Services

Accessing an OpenEdge Web Service

WSA Servlet

Java Servlet Engine

Web service consumer 1

Web Server

WSDL WSAD

HTTP Listener/Sender

SOAP Processor

2

3

Request SOAP over HTTP

© 2006 Progress Software Corporation17SOA-12: Integrate over the Web with OpenEdge Web Services

Accessing an OpenEdge Web Service

OpenEdge AppServer

ABL Business Logic

WSA Servlet

Java Servlet Engine

Web service consumer 1

Web Server

WSDL WSAD

4

HTTP Listener/Sender

SOAP Processor

2

3

© 2006 Progress Software Corporation18SOA-12: Integrate over the Web with OpenEdge Web Services

Accessing an OpenEdge Web Service

OpenEdge AppServer

ABL Business Logic

WSA Servlet

Java Servlet Engine

Web service consumer 1

Web Server

WSDL WSAD

4

HTTP Listener/Sender

SOAP Processor

2

5

3 6

8

© 2006 Progress Software Corporation19SOA-12: Integrate over the Web with OpenEdge Web Services

Accessing an OpenEdge Web Service

OpenEdge AppServer

ABL Business Logic

WSA Servlet

Java Servlet Engine

Web service consumer 1

Web Server

WSDL WSAD

4

HTTP Listener/Sender

SOAP Processor

2

7

5

3 6

8

Request SOAP over HTTP

ResponseSOAP over HTTP

© 2006 Progress Software Corporation20SOA-12: Integrate over the Web with OpenEdge Web Services

Time for a little Demonstration

SOAP WSDL

StandardizedInterfaces!!

© 2006 Progress Software Corporation21SOA-12: Integrate over the Web with OpenEdge Web Services

Demonstration

Developing a Web service • Running ProxyGen

Confirming the Web Server and JSE

Deploying a Web service• Progress Explorer

© 2006 Progress Software Corporation22SOA-12: Integrate over the Web with OpenEdge Web Services

Agenda

The Value of Web Services

OpenEdge Web Service Provider

ABL Client as a Consumer

Integrate over the Web with OpenEdge Web Services

© 2006 Progress Software Corporation23SOA-12: Integrate over the Web with OpenEdge Web Services

Web Services ABL Client Overview

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

© 2006 Progress Software Corporation24SOA-12: Integrate over the Web with OpenEdge Web Services

WSDL Analyzer (command bprowsdldoc)

Input WSDL (obtained from service provider) Output HTML documentation

• ABL code snippets and examples• SOAP/XML samples• Textual information about service

proenv>bprowsdldoc http://localhost:8080/wsa/wsa1/wsdl?targetURI=urn:wsProvider:Emp myOutputDocumentation written toFile:///C:\OpenEdge\WRK\myOutput\index.html

© 2006 Progress Software Corporation25SOA-12: Integrate over the Web with OpenEdge Web Services

WSDL Analyzer Generated Documents

Data types

complex data

Operation Index

Port type

connect& call

Service

index Web Service• ABL connect & call

Port type• Interface

• Persistent procedure

Operations• ABL procedure and

function calls

HTML generated documentation

Operations are modeled as internal procedures

Port type is modeled as a persistent procedure (although it is not persistent)

© 2006 Progress Software Corporation26SOA-12: Integrate over the Web with OpenEdge Web Services

Data Type Mapping

Simple Data Types• XML Schema Progress ABL Data Type

i.e. string CHARACTER

Complex Data• XML document

• LONGCHAR/CHARACTER of serialized XML document

• ProDataSet or TEMP-TABLE when possible

© 2006 Progress Software Corporation27SOA-12: Integrate over the Web with OpenEdge Web Services

Connecting to a Web Service

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' ").

© 2006 Progress Software Corporation28SOA-12: Integrate over the Web with OpenEdge Web Services

Calling a Web Service from the ABL

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 …

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

1

2

4

5

3

© 2006 Progress Software Corporation29SOA-12: Integrate over the Web with OpenEdge Web Services

Calling a Web Service from the ABL

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

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

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

1

2

3

© 2006 Progress Software Corporation30SOA-12: Integrate over the Web with OpenEdge Web Services

OpenEdge Client calling a Web service

Web service

consumer

Web service

provider

HTTP Client

SOAP Processor

WSDL

Request WSDL

Call Service

Service Response

1

2

4

3Client ABL Application

Code

© 2006 Progress Software Corporation31SOA-12: Integrate over the Web with OpenEdge Web Services

Demonstration

WSDL Analyzer Client coding

• Connection

• Operations

Calling a Web service

© 2006 Progress Software Corporation32SOA-12: Integrate over the Web with OpenEdge Web Services

SOAP Envelope Envelope - Encloses message

SOAP Body Body - Encloses body entries

SOAP Header Header (optional)

SOAP Message

Header Entry

Header Entry

Header entries may contain extensions

Body Entry Message name and dataor SOAP Fault(s)

© 2006 Progress Software Corporation33SOA-12: Integrate over the Web with OpenEdge Web Services

SOAP Header

Allows context information to be added to message independently of the payload• Authentication and authorization information

• Transaction id

• Object id

Intermediary specific information • Routing information – to, from, via, etc…

• Security information

• Auditing

Optional

© 2006 Progress Software Corporation34SOA-12: Integrate over the Web with OpenEdge Web Services

ABL SOAP Fault

Envelope

Body

Body Entry

fault code

fault string

fault actor

<fault detail>

© 2006 Progress Software Corporation35SOA-12: Integrate over the Web with OpenEdge Web Services

SOAP Faults

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

SKIP "Fault Detail:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAIL

VIEW-AS ALERT-BOX. END. END.

© 2006 Progress Software Corporation36SOA-12: Integrate over the Web with OpenEdge Web Services

SOAP Viewers (prosoapview)

C:\Progress\OpenEdge\bin\prowin32.exe

-proxyhost localhost -proxyport 4444

© 2006 Progress Software Corporation37SOA-12: Integrate over the Web with OpenEdge Web Services

Improved Complex Data Support

Prior to 10.1A• Complex data represented as a character

string containing an XML document (LONGCHAR)

10.1A for ProDataSet and Temp-Table• Serialized as an XML document• Deserialize XML document

– Analyzer will indicate if the mapping is possible• Recommended for ease of use

NEW

© 2006 Progress Software Corporation38SOA-12: Integrate over the Web with OpenEdge Web Services

Universal Naming Convention (UNC)

OpenEdge 10.1A supports UNC pathnames Using UNC naming

• WSDL Analyzer and CONNECT() method

• WSDLs defining SOAP addresses

• Configuration files in OpenEdge install directory

NEW

/* Example SOAP address using UNC file schema */ hWebService:CONNECT( “-WSDL file:///\\aSystem\aDirectory\test.wsdl”)

© 2006 Progress Software Corporation39SOA-12: Integrate over the Web with OpenEdge Web Services

Wrapped Document Literal

Wrapped document literal• Microsoft developed convention• Document literal message in a specific format • Also known as “Wrapped Doc/Lit”

Document literal handled like remote procedure calls (RPC)

Message is broken down into multiple parameters• Most cases simple data types

• Can also be complex types– Like a Temp-Table or XML document

NEW

© 2006 Progress Software Corporation40SOA-12: Integrate over the Web with OpenEdge Web Services

Unwrapping Wrapped Document Literal

Showing 10.0A default (-show100style)

Always uses LONGCHAR Requires code for XML parsing

© 2006 Progress Software Corporation41SOA-12: Integrate over the Web with OpenEdge Web Services

Unwrapping Wrapped Document Literal

Showing 10.1A default with parameter mapping

© 2006 Progress Software Corporation42SOA-12: Integrate over the Web with OpenEdge Web Services

Improved - Asynchronous Networking Support

10.0B Asynchronous Requests

Web Service

10.1A AsynchronousRequests

Web Service

ABL Client Web Service Consumer

QueuedRequests

ParallelExecution

© 2006 Progress Software Corporation43SOA-12: Integrate over the Web with OpenEdge Web Services

Demonstration

© 2006 Progress Software Corporation44SOA-12: Integrate over the Web with OpenEdge Web Services

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

© 2006 Progress Software Corporation45SOA-12: Integrate over the Web with OpenEdge Web Services

Beyond 10.1A

We are considering Improving complex data support based on OO

initiative SOAP 1.2, WSDL 2.0 Support Integration with OpenEdge Architect Top down Web service design (WSDL First) Improved validation WS-Security ProDataSet support in OpenEdge Web services XPATH, XQUERY, XSLT

© 2006 Progress Software Corporation46SOA-12: Integrate over the Web with OpenEdge Web Services

In Summary

Understand Web Services

Identify when to use Web Services

Implementing an OpenEdge service provider

Implementing an OpenEdge service consumer

Implementing OpenEdge Web Services

Web service

provider

Web service

consumerClient

Web service

Standards

© 2006 Progress Software Corporation47SOA-12: Integrate over the Web with OpenEdge Web Services

Relevant Exchange Sessions

All of the sessions in the SOA track SOA-1: Fundamentals of Service-Oriented

Architecture SOA-5: Accessing the Application Server

from Anywhere and Everywhere SOA-10: Application Servers, Web Services

and Integration Info Exchange

© 2006 Progress Software Corporation48SOA-12: Integrate over the Web with OpenEdge Web Services

Education / Documentation References

Courses• What’s new in 10.1A : SOA Support

• Consuming Web Services from OpenEdge

• Opening 4GL Applications to Web Services Clients

• Distributed AppServer Application Development

Documentation• OpenEdge Development: Web Services

© 2006 Progress Software Corporation49SOA-12: Integrate over the Web with OpenEdge Web Services

Questions?

© 2006 Progress Software Corporation50SOA-12: Integrate over the Web with OpenEdge Web Services

Thank you foryour time

© 2006 Progress Software Corporation51SOA-12: Integrate over the Web with OpenEdge Web Services