Web Services With Delphi, Sep, 2008
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Web Services With Delphi, Sep, 2008

on

  • 4,375 views

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

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

Statistics

Views

Total Views
4,375
Views on SlideShare
4,368
Embed Views
7

Actions

Likes
0
Downloads
39
Comments
0

1 Embed 7

http://www.slideshare.net 7

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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 Presentation Transcript

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