Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 4 - Creating a Web Service Client with Delphi
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Creating a Web Service Client with Delphi
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2006-10-30

    Table of Contents:
  • Creating a Web Service Client with Delphi
  • Code Listing
  • The application
  • Behind the scenes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating a Web Service Client with Delphi - Behind the scenes


    (Page 4 of 4 )

    So what is happening behind the scenes when you execute the code? Well, the HTTPRIO component creates a SOAP envelop and sends this off to the web service server, which in turn processes the message and returns an appropriate response. The messages, both outgoing and incoming, are in XML  format:

    Outgoing message:

    <?xml version="1.0"?>

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=http://www.w3.org/2001/XMLSchema
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-
    ENV:Body>
    <GetWeatherByPlaceName xmlns="http://www.webservicex.net">
    <PlaceName>london</PlaceName>
    </GetWeatherByPlaceName>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    You can clearly see the place name parameter that we entered. In this case it is London. Below is the response message we get from the web service server:

    Incoming message:

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope
    xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/
    xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <GetWeatherByPlaceNameResponse xmlns="http://www.webservicex.net">
    <GetWeatherByPlaceNameResult><Latitude>30.6171017</Latitude>
    <Longitude>99.62553</Longitude>
    <AllocationFactor>2.7E-05</AllocationFactor>
    <FipsCode>48</FipsCode>
    <PlaceName>LONDON</PlaceName>
    <StateCode>TX</StateCode>
    <Details><WeatherData>
    <Day>Sunday, August 13, 2006</Day>
    <WeatherImage>http://www.nws.noaa.gov/weather/images/fcicons/
    nscttsra10.jpg
    </WeatherImage>
    ….
    </soap:Body>
    </soap:Envelope>

    The Delphi SOAP framework does all the hard work of putting together the SOAP envelope and sending it off to the server; then it reads the response and converts the XML into a human readable form.

    Conclusion

    In this article we went through the process of building a web service client and also discussed the various components and methods needed to make an application work. In the next article we are going to create a web service from scratch and also create a client that will enable us to use the service.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · In this article i explain how to create a webservice client with Delphi.
     

    DELPHI-KYLIX ARTICLES

    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT