int-5: integrate over the web with openedge ® web services matthew harrison senior software...
TRANSCRIPT
INT-5: Integrate over the Web with OpenEdge® Web Services
Matthew HarrisonSenior Software Engineer,
Progress OpenEdge
© 2007 Progress Software Corporation2 INT-5: Integrate over the Web with OpenEdge® Web Services
Initial Audience Reaction
© 2007 Progress Software Corporation3 INT-5: Integrate over the Web with OpenEdge® Web Services
Session Focus
Implementing OpenEdge Web Services
Understanding Web Services Identify when to use Web Services Implementing an OpenEdge service consumer Implementing an OpenEdge service provider
© 2007 Progress Software Corporation4 INT-5: 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
© 2007 Progress Software Corporation5 INT-5: Integrate over the Web with OpenEdge® Web Services
What is Web Services?
Web Services• A set of standards that comprise a platform for
building distributed, interoperable applications
OpenEdge Web Services utilizes W3C standards• Simple Object Access Protocol (SOAP)
• Web Service Definition Language (WSDL)
• XML
W3C = World Wide Web Consortium, http://www.w3.org/
Web Services is Defined by Standards
© 2007 Progress Software Corporation6 INT-5: Integrate over the Web with OpenEdge® Web Services
Standards: SOAP
Protocol for message exchange XML-based Independent of encoding, transport,
language, and platform
Simple Object Access Protocol
© 2007 Progress Software Corporation7 INT-5: 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
© 2007 Progress Software Corporation8 INT-5: Integrate over the Web with OpenEdge® Web Services
Consumers and Providers
Web service
provider
Web service
consumer
Client
SOAP
over HTTP
Web Service Provider• Develops and deploys the Web service• Publishes the WSDL
Web Service Consumer• Writes code to access deployed services based on the
WSDL contract
© 2007 Progress Software Corporation9 INT-5: Integrate over the Web with OpenEdge® Web Services
The Value of Web Services
Why to use Web Services• Heterogeneous applications
• Many valuable Services are available
• Many consumers
Why not to use Web Services• Homogenous applications
• May not be efficient enough
Why use Progress for Web Services?Progress makes it easy.
© 2007 Progress Software Corporation10 INT-5: Integrate over the Web with OpenEdge® Web Services
Web Services
Heterogeneous Distributed Interoperable SOAP WSDL Consumers Providers
What are we really talking about?
© 2007 Progress Software Corporation11 INT-5: Integrate over the Web with OpenEdge® Web Services
Web Services Demonstration
© 2007 Progress Software Corporation12 INT-5: Integrate over the Web with OpenEdge® Web Services
Agenda
The Value of Web Services
ABL Client as a Consumer
OpenEdge Web Service Provider
Integrate over the Web with OpenEdge Web Services
© 2007 Progress Software Corporation13 INT-5: Integrate over the Web with OpenEdge® Web Services
Web Services ABL Client Requirements
• How to use the WSDL Analyzer• A little AppServer™ persistent procedure
syntax
What do I need to know?
That’s all!
© 2007 Progress Software Corporation14 INT-5: Integrate over the Web with OpenEdge® Web Services
Web Services ABL Client Process
Obtain WSDL (or its location) Run the WSDL Analyzer on the WSDL
• Generates ABL code snippets in HTML form
Use WSDL Analyzer information to code calls to Web service
Call the Web service
© 2007 Progress Software Corporation15 INT-5: 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
© 2007 Progress Software Corporation16 INT-5: 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
© 2007 Progress Software Corporation17 INT-5: Integrate over the Web with OpenEdge® Web Services
The WSDL Analyzer
Connection information How to create a Port type (Persistent
Procedure) Lists all the Operations (Internal Procedures) How to call each Operation
• Procedure and Function syntax
Data type format
Output includes:
Port type is modeled as a persistent procedure (although it is not persistent)
Operations are modeled as internal procedures
© 2007 Progress Software Corporation18 INT-5: Integrate over the Web with OpenEdge® Web Services
The WSDL Analyzer
There is no guarantee (It is a guideline) No disconnect and cleanup information:
DELETE OBJECT hPortType.hWebService:DISCONNECT().DELETE OBJECT hWebService.
Output limitations:
© 2007 Progress Software Corporation19 INT-5: Integrate over the Web with OpenEdge® Web Services
Demonstration: Calling a Web service
© 2007 Progress Software Corporation20 INT-5: Integrate over the Web with OpenEdge® Web Services
Agenda
The Value of Web Services
ABL Client as a Consumer
OpenEdge Web Service Provider
Integrate over the Web with OpenEdge Web Services
© 2007 Progress Software Corporation21 INT-5: 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 intermediate file used for deployment
(includes wsdl mapping information)
Progress Explorer or wsaman• Manage Web service (deployment)
Required Components
© 2007 Progress Software Corporation22 INT-5: Integrate over the Web with OpenEdge® Web Services
OpenEdge Web Service Provider
WSA Servlet • Interface between the Web Service Consumer and the
OpenEdge AppServer™
3rd Party Products• Java Servlet Engine (JSE)
– Provides environment to run WSA servlet
• Web Server– Provides HTTP support– Hosts JSE
Required Components
WSA = Web Services Adapter
© 2007 Progress Software Corporation23 INT-5: 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 WSM
3
Progress Explorer or
wsaman
Intermediate file used for Web service deployment
WSAD
© 2007 Progress Software Corporation24 INT-5: 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
WSAD
4
HTTP Listener/Sender
SOAP Processor
2
7
5
3 6
8
© 2007 Progress Software Corporation25 INT-5: Integrate over the Web with OpenEdge® Web Services
Demonstration: Deploying a Web service
© 2007 Progress Software Corporation26 INT-5: Integrate over the Web with OpenEdge® Web Services
Web Services Troubleshooting
Envelope
Body
Body Entry
fault code
fault string
fault actor
<fault detail>
ABL SOAP Fault
© 2007 Progress Software Corporation27 INT-5: 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.
© 2007 Progress Software Corporation28 INT-5: Integrate over the Web with OpenEdge® Web Services
SOAP Viewers (prosoapview)
C:\Progress\OpenEdge\bin\prowin32.exe
-proxyhost localhost -proxyport 4444
© 2007 Progress Software Corporation29 INT-5: Integrate over the Web with OpenEdge® Web Services
In Summary
Understand Web Services Identify when to use Web Services Progress makes it easy
Implementing OpenEdge Web Services
Web service
provider
Web service
consumerClient
SOAP
over HTTP
© 2007 Progress Software Corporation30 INT-5: Integrate over the Web with OpenEdge® Web Services
For More Progress Information, go to…
Progress eLearning Community:• WSDL for OpenEdge Developers• Consuming Web Services from OpenEdge• Opening 4GL Applications to Web Services
Clients
Documentation:• 10.1B Web Services manual• ProxyGen Changes for Web Services in
OpenEdge 10.1A
© 2007 Progress Software Corporation31 INT-5: Integrate over the Web with OpenEdge® Web Services
For More Web Services Information, go to…
The World Wide Web Consortium (W3C)• http://www.w3.org/
Web Services Interoperability Organization• http://www.ws-i.org/Default.aspx
• WS-I Basic Profile: – http://www.ws-i.org/Profiles/BasicProfile-1.0-
2004-04-16.html
W3 Schools• http://www.w3schools.com/
© 2007 Progress Software Corporation32 INT-5: Integrate over the Web with OpenEdge® Web Services
Questions?
© 2007 Progress Software Corporation33 INT-5: Integrate over the Web with OpenEdge® Web Services
Thank you foryour time
© 2007 Progress Software Corporation34 INT-5: Integrate over the Web with OpenEdge® Web Services