Oregon Delphi User Group September, 2008
<ul><li>What are web services—very briefly </li></ul><ul><ul><li>Remotely invokable methods with a pre-defined API </li></...
<ul><li>Single store, one database, simple accounting. </li></ul>ODUG - Web Services, Sep 2008
<ul><li>Add an ecommerce web site. </li></ul><ul><li>Two databases—accountant is not happy. </li></ul><ul><li>Shipping dep...
<ul><li>Need to merge—but how? </li></ul>ODUG - Web Services, Sep 2008
<ul><li>The answer of course for today: Web Services! </li></ul>ODUG - Web Services, Sep 2008
<ul><li>What is needed here? </li></ul><ul><ul><li>Web site needs to know what inventory is available </li></ul></ul><ul><...
<ul><li>Possible web service methods: </li></ul><ul><ul><li>UpdateInventory </li></ul></ul><ul><ul><ul><li>Adds or updates...
<ul><li>File > New </li></ul><ul><ul><li>Other > Web Services >  SOAP Server Application </li></ul></ul><ul><li>Three type...
<ul><li>Four modules created </li></ul><ul><ul><li>__Intf.pas </li></ul></ul><ul><ul><ul><li>Exposed methods for the web s...
<ul><li>Add interface and implementation </li></ul><ul><ul><li>Intf and Impl units </li></ul></ul><ul><li>Build/Run once t...
<ul><li>Questions? </li></ul><ul><li>Now on to the Client… </li></ul>ODUG - Web Services, Sep 2008
<ul><li>New standard VCL application </li></ul><ul><li>File > New </li></ul><ul><ul><li>Other > Web Services >  WSDL Impor...
<ul><li>Call a method—see the answer—SUCCESS! </li></ul><ul><li>Web App Debugger </li></ul><ul><ul><li>View the log </li><...
<ul><li>Web Apps –vs- Windows Apps </li></ul><ul><ul><li>No form </li></ul></ul><ul><ul><li>Stateless </li></ul></ul><ul><...
<ul><li>Web Service </li></ul><ul><ul><li>Add(a, b: Double): Double; </li></ul></ul><ul><ul><li>Subtract(a, b: Double): Do...
<ul><li>Database queries </li></ul><ul><li>Arrays </li></ul><ul><li>TRemotable class </li></ul>ODUG - Web Services, Sep 2008
<ul><li>Packet Size </li></ul><ul><ul><li>Server speed </li></ul></ul><ul><ul><li>Bandwidth bottleneck </li></ul></ul><ul>...
<ul><li>eCommerce </li></ul><ul><ul><li>Sample packets </li></ul></ul><ul><ul><li>XML Notepad </li></ul></ul><ul><li>Googl...
ODUG - Web Services, Sep 2008
Upcoming SlideShare
Loading in …5
×

Web Services With Delphi, Sep, 2008

2,617 views

Published on

Describes the steps necessary to build web services (both server-side and client-side) in Delphi.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,617
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
45
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Brief introduction Real Life example to help you visualize purpose Build simple web service with Delphi (3 ways: ISAPI DLL, .EXE, WebApp) Build client that talks to web service (consumes) Build more complex web service and client Show WSDL
  • Web Services With Delphi, Sep, 2008

    1. 1. Oregon Delphi User Group September, 2008
    2. 2. <ul><li>What are web services—very briefly </li></ul><ul><ul><li>Remotely invokable methods with a pre-defined API </li></ul></ul><ul><ul><ul><li>Parameters (object with properties) </li></ul></ul></ul><ul><ul><ul><li>Return values (object with properties) </li></ul></ul></ul><ul><ul><ul><li>SOAP XML via HTTP </li></ul></ul></ul><ul><li>Another way of saying it… “ Web Services, in the general meaning of the term, are processes offered via the Web. In a typical Web Services scenario, a business application sends a request to a service at a given URL using the SOAP protocol over HTTP. The service receives the request, processes it, and returns a response.” –Harms Software </li></ul>ODUG - Web Services, Sep 2008
    3. 3. <ul><li>Single store, one database, simple accounting. </li></ul>ODUG - Web Services, Sep 2008
    4. 4. <ul><li>Add an ecommerce web site. </li></ul><ul><li>Two databases—accountant is not happy. </li></ul><ul><li>Shipping department confused. </li></ul><ul><li>Customers can “buy” out-of-stock items. </li></ul>ODUG - Web Services, Sep 2008
    5. 5. <ul><li>Need to merge—but how? </li></ul>ODUG - Web Services, Sep 2008
    6. 6. <ul><li>The answer of course for today: Web Services! </li></ul>ODUG - Web Services, Sep 2008
    7. 7. <ul><li>What is needed here? </li></ul><ul><ul><li>Web site needs to know what inventory is available </li></ul></ul><ul><ul><li>Store needs to collect order information </li></ul></ul><ul><ul><li>Store needs to adjust inventory levels </li></ul></ul><ul><ul><li>Store needs to ship products </li></ul></ul><ul><ul><li>Store needs to notify web site of order status </li></ul></ul><ul><ul><li>Web site needs to display order status </li></ul></ul>ODUG - Web Services, Sep 2008
    8. 8. <ul><li>Possible web service methods: </li></ul><ul><ul><li>UpdateInventory </li></ul></ul><ul><ul><ul><li>Adds or updates items to web database </li></ul></ul></ul><ul><ul><li>GetPendingOrders </li></ul></ul><ul><ul><ul><li>Get list of orders pending from web </li></ul></ul></ul><ul><ul><ul><li>Get single order details from web </li></ul></ul></ul><ul><ul><li>UpdateOrderStatus </li></ul></ul><ul><ul><ul><li>Update status field and tracking number on web </li></ul></ul></ul>ODUG - Web Services, Sep 2008
    9. 9. <ul><li>File > New </li></ul><ul><ul><li>Other > Web Services > SOAP Server Application </li></ul></ul><ul><li>Three types </li></ul><ul><ul><li>ISAPI .DLL </li></ul></ul><ul><ul><li>CGI Stand-alone .EXE </li></ul></ul><ul><ul><li>Web App Debugger </li></ul></ul><ul><li>Create an interface </li></ul><ul><ul><li>File > new </li></ul></ul><ul><ul><ul><li>Other > Web Services > SOAP Server Interface </li></ul></ul></ul>ODUG - Web Services, Sep 2008
    10. 10. <ul><li>Four modules created </li></ul><ul><ul><li>__Intf.pas </li></ul></ul><ul><ul><ul><li>Exposed methods for the web services </li></ul></ul></ul><ul><ul><ul><li>IMyWebClass = class(Invokable) </li></ul></ul></ul><ul><ul><li>__Impl.pas </li></ul></ul><ul><ul><ul><li>Delphi implementation of web services </li></ul></ul></ul><ul><ul><ul><li>TMyWebClass = class(TInvokableClass, IMyWebClass) </li></ul></ul></ul><ul><ul><ul><li>Here’s the meat! </li></ul></ul></ul><ul><ul><li>Data module – web service work horse </li></ul></ul><ul><ul><li>Main Form – standard application </li></ul></ul>ODUG - Web Services, Sep 2008
    11. 11. <ul><li>Add interface and implementation </li></ul><ul><ul><li>Intf and Impl units </li></ul></ul><ul><li>Build/Run once to register COM object </li></ul><ul><li>Run Web App Debugger, start server </li></ul><ul><li>Verify new web service available in browser </li></ul><ul><li>View WSDL automatically created for us </li></ul><ul><ul><li>What’s a WSDL? </li></ul></ul><ul><ul><ul><li>W eb S ervice D escription L anguage </li></ul></ul></ul><ul><ul><ul><li>XML document describing the web service </li></ul></ul></ul><ul><li>We’ve Created a Web Service! </li></ul>ODUG - Web Services, Sep 2008
    12. 12. <ul><li>Questions? </li></ul><ul><li>Now on to the Client… </li></ul>ODUG - Web Services, Sep 2008
    13. 13. <ul><li>New standard VCL application </li></ul><ul><li>File > New </li></ul><ul><ul><li>Other > Web Services > WSDL Importer </li></ul></ul><ul><ul><li>URL of web service’s WSDL </li></ul></ul><ul><ul><li>New unit created </li></ul></ul><ul><ul><ul><li>Full Interface to web service methods! </li></ul></ul></ul>ODUG - Web Services, Sep 2008
    14. 14. <ul><li>Call a method—see the answer—SUCCESS! </li></ul><ul><li>Web App Debugger </li></ul><ul><ul><li>View the log </li></ul></ul><ul><ul><li>See the XML packets </li></ul></ul><ul><ul><ul><li>Get/Response – general web page requests </li></ul></ul></ul><ul><ul><ul><li>POST – web service method calls </li></ul></ul></ul>ODUG - Web Services, Sep 2008
    15. 15. <ul><li>Web Apps –vs- Windows Apps </li></ul><ul><ul><li>No form </li></ul></ul><ul><ul><li>Stateless </li></ul></ul><ul><ul><li>Multi-user </li></ul></ul><ul><li>Acronymns </li></ul><ul><ul><li>HTTP – HyperText Transfer Protocol </li></ul></ul><ul><ul><li>XML – eXtended Markup Language </li></ul></ul><ul><ul><li>SOAP – Simple Object Access Protocol </li></ul></ul><ul><ul><li>RIO – Remote Invokable Object </li></ul></ul><ul><ul><li>WSDL – Web Service Description Language </li></ul></ul><ul><ul><li>UDDI – Universal Description, Discovery, and Integration </li></ul></ul>ODUG - Web Services, Sep 2008
    16. 16. <ul><li>Web Service </li></ul><ul><ul><li>Add(a, b: Double): Double; </li></ul></ul><ul><ul><li>Subtract(a, b: Double): Double; </li></ul></ul><ul><li>Client </li></ul><ul><ul><li>Two edit fields, two buttons, display answer </li></ul></ul>ODUG - Web Services, Sep 2008
    17. 17. <ul><li>Database queries </li></ul><ul><li>Arrays </li></ul><ul><li>TRemotable class </li></ul>ODUG - Web Services, Sep 2008
    18. 18. <ul><li>Packet Size </li></ul><ul><ul><li>Server speed </li></ul></ul><ul><ul><li>Bandwidth bottleneck </li></ul></ul><ul><li>Trapping XML </li></ul><ul><ul><li>Logging/modifying XML on-the-fly </li></ul></ul><ul><ul><ul><li>Use HTTPRIO from WebServices </li></ul></ul></ul><ul><ul><ul><li>Use TXMLDocument from Internet </li></ul></ul></ul><ul><li>Tutorial Reference </li></ul><ul><ul><li>http://exposureroom.com/members/skumar.aspx/tutorials/post/1 </li></ul></ul>ODUG - Web Services, Sep 2008
    19. 19. <ul><li>eCommerce </li></ul><ul><ul><li>Sample packets </li></ul></ul><ul><ul><li>XML Notepad </li></ul></ul><ul><li>Google </li></ul><ul><li>eBay </li></ul><ul><li>Amazon </li></ul><ul><li>FedEx </li></ul><ul><li>CDDB </li></ul><ul><li>MapPoint </li></ul><ul><li>More! </li></ul>ODUG - Web Services, Sep 2008
    20. 20. ODUG - Web Services, Sep 2008

    ×