1 / 18

Accessing a Web service

Accessing a Web service. Overview. When you complete this lesson you should be able to:. Describe the steps for accessing a Web service Implement the 4GL code for invoking a Web service operation. Steps for accessing a Web service. NewCo Web Service. WSDL: operations: SendOrders

lin
Download Presentation

Accessing a Web service

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Accessing a Web service

  2. Overview When you complete this lesson you should be able to: • Describe the steps for accessing a Web service • Implement the 4GL code for invoking a Web service operation

  3. Steps for accessing a Web service NewCo Web Service WSDL: operations: SendOrders GetInvoice 2c WSDL Analyzer NewCoService.wsdl 1 3 • Development: • Understand the WSDL • Run-time: • Connect to Web service • Establish portType HANDLE • Prepare to invoke operation • cMyOrder = . . . • Invoke operation • Process result of operation • iNum = iInvoiceNum. • Disconnect from Web service • SERVER-DISCONNECT(). SERVER-CONNECT() 2a NewCoService.wsdl 2b RUN SendOrders(cMyOrder) 4a iInvoiceNum 4b

  4. WSDL requirements for 4GL clients The WSDL must define: • The connection information for the service • The names of the port type(s) • The operations for each port type • Name • Parameter • Types of parameters • The bindings available for a service

  5. How to use the Web service? WSDL may contain: • Documentation about the service • Documentation for each operation • Documentation about how operations can be used together Web service provider should have detailed documentation available to consumers of the Web service (provided in the WSDL or by some other means)

  6. Connecting to a Web service

  7. Connection details from WSDL Analyzer

  8. Web service connection

  9. 4GL code setting up the procedure handle /* Definitions section */ DEFINE VARIABLEhPortTypeAS HANDLE NO-UNDO. /* Main Block section */ /* get ready to invoke the operation on the service */ /* Web service connection made */ RUN NewCoService2Obj SET hPortType ON SERVER hServer. IF NOT VALID-HANDLE(hPortType) THEN DO: MESSAGE "Could not establish the portType procedure handle" VIEW-AS ALERT-BOX INFO BUTTONSOK. APPLY “CLOSE”:U TO THIS-PROCEDURE. RETURN. END.

  10. Setting the portType procedure handle

  11. Operation information from WSDL Analyzer

  12. Invoking an operation

  13. Prototype for function from WSDL Analyzer

  14. Example function from WSDL Analyzer

  15. Disconnecting from the Web service

  16. Lab 3-1:Accessing a Web service

  17. Summary You should now be able to: • Describe the steps for accessing a Web service • Implement the 4GL code for invoking a Web service operation

  18. Review

More Related