Presentation is loading. Please wait.

Presentation is loading. Please wait.

Call Any Web Service from the Progress 4GL

Similar presentations


Presentation on theme: "Call Any Web Service from the Progress 4GL"— Presentation transcript:

1 Call Any Web Service from the Progress 4GL
Michael Resnick Principal Software Engineer SOA-07: Call Any Web Service from the Progress 4GL Description: OpenEdge 10 supports the ability to easily invoke functionality that is exposed as a Web service.  Learn about the tools and the Progress 4GL constructs that you will use to invoke a Web service method.  learn the basic steps required to call out to a Web service from the Progress 4GL.  Start with a WSDL file - the standards-based definition for a Web service - and learn how the WSDL Analyzer  makes it simple to invoke a Web services application and how the 4GL hides the complexity of dealing with SOAP messages. You'll also learn how complex data is handled in the 4GL.  A demonstration will show a Progress 4GL program interacting with a live Web service on the Internet.

2 Under Development D I S C L A I M E R
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 Agenda Introduction Web Service Basics WSDL Analyzer
Calling A Web Service from the 4GL Coming in 10.1A And Beyond

4 Web Service Client Available in OpenEdge® 10.0A AppServer not needed
Client to a different application

5 Web Services – Why? Heterogeneous connectivity
In SOA makes distributed services possible Lower common denominator than either EDI or CORBA

6 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 Web Services – Why Not? May not be efficient May not be available

8 Web Service Basics - Where?
Users Enterprise Services Presentation Layer Integration Layer Business Servicing Layer Environment Managers and Utilities Data Access Layer Managed Data Stores Unmanaged Data Stores

9 Agenda Introduction Web Service Basics WSDL Analyzer
Calling A Web Service from the 4GL Coming in 10.1A And Beyond

10 Web Service Basics – SOAP Message
imple O bject A ccess P rotocol Envelope Body Header Header Entry Body Entry Header optional Entries may be SOAP Faults (errors)

11 Web Service Basics - WSDL
escription L anguage Defines Interface Data encoding Transport Service address Contract between client and server

12 Anatomy of a Web Service Session
WSDL Request A Web Service Provider WSDL Response OpenEdge 4GL Client SOAP Request SOAP Response SOAP Request SOAP Response

13 Agenda Introduction Web Service Basics WSDL Analyzer
Analyzer demonstration Calling A Web Service from the 4GL Coming in 10.1A And Beyond

14 4GL/WSDL Dictionary 4GL WSDL
AppServer™.…......… Web service Persistent procedure Port type (interface) Internal procedure Operation

15 WSDL Analyzer Command Line
Generates 4GL documentation for a web service C:\temp> bprowsdldoc google Documentation written to file:///c:\temp\google\index.html C:\temp>

16 Anatomy of Client Design
WSDL Request Web Service Provider WSDL Analyzer WSDL Response OpenEdge 4GL Client Generated Documents

17 Generated Documents Service Port type Data types Operation Index index
connect & call Data types complex data Operation Index

18 Analyzer Demo Snapshots: Service Documentation

19 Analyzer Demo Snapshots: Service Document

20 Analyzer Demo Snapshots: Port Type – Connection Summary

21 Analyzer Demo Snapshots: Port Type – Operation Summary

22 Analyzer Demo Snapshots: Port Type – Operation Example

23 Analyzer Demo Snapshots: Port Type – Operation Parameters

24 Analyzer Demo Snapshots: Port Type – Complex Parameter Example

25 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 Complex Data as TEMP-TABLE
Example DEFINE TEMP-TABLE customerList NAMESPACE-URI 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 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 namespace. As such, this parameter can be passed as a CHARACTER or LONGCHAR value containing an XML document. View example of XML.

28 Agenda 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

29 Simple Data Type Map XML Schema Data Type Progress 4GL Data Type
string CHARACTER boolean LOGICAL decimal DECIMAL integer INTEGER float, double, duration CHARACTER and LONGCHAR can always be used For complete mappings see documentation

30 Complex Data Represented two ways:
LONGCHAR/CHARACTER of serialized XML document ProDataSet or TEMP-TABLE when possible (10.1A) Analyzer shows examples for each.

31 Connecting and Calling Just Like An AppServer
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). 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).

32 Google Results in Browser

33 Selected Connection Example

34 Pasted Connection and Call Examples

35 Variable Definitions in Completed .p

36 Connect and Set Port in Completed .p

37 Call to Google in Completed .p

38 Search Results Using DOM

39 Load TEMP-TABLE with Results

40 4GL Client Results

41 … … 4GL SOAP Header Objects SOAP-HEADER Envelope Header Header Entry
SOAP-HEADER-ENTRYREF SOAP-HEADER-ENTRYREF Body Body Entry

42 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 Anatomy Of A Web Service Error
WSDL Request Web Service Provider WSDL Response OpenEdge 4GL Client SOAP Request SOAP Response (FAULT)

44 4GL SOAP Fault Envelope Body Body Entry fault code fault string
fault actor <faultdetail>

45 4GL Fault Objects ERROR-STATUS SOAP-FAULT fault info SOAP-FAULT-DETAIL
XML

46 SOAP Fault - Faultstring
An error was detected while executing the Web Service request. (10893)

47 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 Agenda Introduction Web Service Basics WSDL Analyzer
Calling A Web Service from the 4GL Coming in 10.1A And Beyond

49 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 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 Web Service or AppServer?
In Summary Calling a web service is easy Use the WSDL Analyzer OpenEdge 4GL Client Web Service or AppServer?

52 SOAP 1.1 Specification SOAP 1.1
Notes (submissions by member organizations) Simple Object Access Protocol (SOAP) 1.1

53 SOAP 1.2 Specifications (1/4)
Recommendations (standards) Base SOAP Version 1.2 Part 0: Primer SOAP Version 1.2 Part 1: Messaging Framework SOAP Version 1.2 Part 2: Adjuncts SOAP Version 1.2 Specification Assertions and Test Collection

54 SOAP 1.2 Specifications (2/4)
Recommendations (standards) Ancillary SOAP Message Transmission Optimization Mechanism Resource Representation SOAP Header Block

55 SOAP 1.2 Specifications (3/4)
Drafts (submitted by W3C working groups; will become recommendations) SOAP 1.2 Attachment Feature SOAP Version 1.2 Message Normalization SOAP Optimized Serialization Use Cases and Requirements

56 SOAP 1.2 Specifications (4/4)
Notes (submitted by W3C working groups or member organizations) SOAP Version 1.2 Usage Scenarios SOAP Version 1.2 Binding

57 WSDL 1.1 Specification WSDL 1.1
Notes (submitted by member organizations) Web Services Description Language (WSDL) 1.1

58 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 Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language Web Services Description Language (WSDL) Version 2.0 Part 3: Bindings Web Services Description Language (WSDL) Version 2.0 Part 2: Predefined Extensions

59 Google Web Service Site
Google Web APIs (beta)

60 Questions?

61 Thank you for your time!

62


Download ppt "Call Any Web Service from the Progress 4GL"

Similar presentations


Ads by Google