Home arrow Delphi-Kylix arrow Page 2 - Building a Web Service from Scratch with Delphi
DELPHI-KYLIX

Building a Web Service from Scratch with Delphi


In the previous article you saw how easy it is to create a client and access web services written in other programming languages. While in the previous article you accessed a web service that was already running, in this article we will be creating our own web service from scratch and create a client to access it.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 10
November 06, 2006
TABLE OF CONTENTS:
  1. · Building a Web Service from Scratch with Delphi
  2. · Writing the Methods
  3. · Adding state
  4. · Testing the service

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Building a Web Service from Scratch with Delphi - Writing the Methods
(Page 2 of 4 )

We need to write our own methods, so I'm going to create two very simple methods to which this service will respond. Go to the interface unit and add the following two methods under the IMyWebServer class definition:

Procedure SetTxt(Const AValue : String); stdcall;

Function GetTxt : String; stdcall;

Then go to the implementation unit and under the TMyWebServer class definition add the following two lines:

Private

 TheTxt : String;

And then under these two add the following:

Procedure SetTxt(Const AValue : String); stdcall;

Function GetTxt : String; stdcall;

Then in the implementation section of the unit, add the following code:

function TMyWebServer.GetTxt: String;
begin 
  Result := TheTxt;
end;
procedure TMyWebServer.SetTxt(const AValue: String);
begin 
 TheTxt := AValue;
end;

So, what does the code do? Well, one of them (settxt) gets parameters from the user and the other reads it and shows the data.


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- 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...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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