Home arrow Delphi-Kylix arrow Creating a Web Service Client with Delphi

Creating a Web Service Client with Delphi

In this article, the second of three parts covering web services, we will build a web service client and discuss the various components and methods needed to make an application work.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 34
October 30, 2006
  1. · Creating a Web Service Client with Delphi
  2. · Code Listing
  3. · The application
  4. · Behind the scenes

print this article

Creating a Web Service Client with Delphi
(Page 1 of 4 )

A downloadable file for this article is available here.

In the previous article we learned what a web service is and examined the kind of code used to create one. We also looked at some actual WSDL, XML and SOAP code. In the second part of the "Web Services Made Easy" series we are going to create a web service client for an already existing web service, and then we are going to create our own simple web service and client with Borland Delphi. This is because I want you to see how easy it is to access a web service that is already built by someone else in a different programming  language. We will create our own custom web service because in this way you will learn how to create your own methods for the web service and also how to access them. Since we’ve done a lot of theoretical work in the first part, I feel it is time to demonstrate everything we discussed, in practice.

Building a web service client

The first client we are going to create is going to be a service that will give us the weather forecast for international cities such as London or Paris. So open up your web browser and go to http://www.xmethods.com/. There you will see a complete listing of all the web services that are available, as well as what programming language was used to create them.

Click on the link that says "View full listing" and then press "ctrl + f" to bring up the find dialog box (I.E. browsers only). Type in "USA Weather Forecast" and then click on "find next." This should take you straight to the "USA Weather Forecast" link. Click on the link and then find the label that says "WSDL." Copy the link next to it. Now start Delphi, go to File|New|Other, and then click on the web services tab. You should now see a dialog like this:

Click on the  WSDL importer icon. You should now see the following screen:

Enter the link you copied and click on "next." You should now see the following screen:

Click on "finish" and Delphi will create a unit called "Weatherforecast" for you. Save the unit. We'll take a look at the unit's code listing in the next section.

blog comments powered by Disqus

- Loading an XML Document into the DOM
- 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...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials