Temperature Conversion Service
Endpoints
Contributed Clients What is this? Add / Edit / Delete Client
Detailed Description
This Web service performs Fahrenheit to Centigrade and Centigrade to
Fahrenheit conversions. The service current contains two
functions:
CtoF and FtoC. Both functions take an integer argument and return an
integer result. CtoF takes an integer representing a Centigrade
temperature and returns its Fahrenheit equivalent. FtoC takes an
integer representing a Fahrenheit temperature and returns its
Centigrade equivalent.
This simple Web service is described in the seminar Delphi 6 Web
Services, XML, and Socket Programming, which is part of the Delphi
Developer Days seminar series. Visit www.DelphiDeveloperDays.com for
more information.
Usage Notes
Delphi 6 Enterprise developers wanting to use this service should
paste the WSDL URL into the WSDL or XML Schema Location field of the
Web Services Importer Wizard and then click the Generate button to
create the ITempConverter interface declaration. This wizard is
located on the WebServices page of the Object Repository.
Once you have generated the interface, declare a variable of type
ITempConverter and assign to it a reference to an HTTPRIO component.
Set the URL property of the HTTPRIO to the following SOAP endpoint
URL:
http://developerdays.com/cgi-bin/tempconverter.exe/soap/ITempConverter
Dynamically bind the HTTPRIO to the ITempConverter interface, and
assign this to the ITempConverter variable. You can then use the
variable to invoke CtoF and FtoC. In Delphi this looks like the
following:
var
TempConverter: ITempConverter;
Temp: Integer;
begin
TempConverter := HTTPRIO1 as ITempConverter;
Temp := TempConverter.CtoF(100);
ShowMessage(IntToStr(temp)); //displays 212
end;
Help Message Board