faqts : Computers : Programming : Languages : Delphi

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 16 people (63%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

Delphi: Web services: Create: How to quickly create a webservice using Delphi?: Drive directions

Sep 22nd, 2003 04:45
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 12 September 2003 - 07:22 - 09:32 pm ----------

Delphi: Web services: Create: How to quickly create a webservice using 
Delphi?: Drive directions

The example shows how to create a webservice which shows you the 
directions (using the http://www.mapquest.com webservice).

---

Video showing how to quickly create a webservice using Delphi:

http://info.borland.com/media/shockwave/d7_webservice_xp_themes.html

---

Delphi 7:

Steps: Overview:

 1. -Open a form

 2. -select from menu option 'File'

 3. -select from list 'New'

 4. -select from list 'Other'

 5. -select tab 'Web services'

 6. -select 'WSDL importer'

 7. -select from list 'XMethods'

 8. -click button 'Search UDDI'

 9. -search for 'Anders'

10. -this should find 'AndersOlsson'

11. -expand this (by clicking the '+')

12. -select from list 'MapQuest'

13. -select from list 'Soap binding'

14. -click button 'import WSDL'

15. -but I then get a Windows message box, showing the error:

     '*Error*: 'http://ww6.borland.com/webservices/MapQuest/MapQuest.ex
e/wsdl/IMapQuest#IMapQuestbinding' - Missing <definition> node of 
namespace "http://schemas.xmlsoap.org/wsdl/"

http://www.faqts.com/knowledge_base/view.phtml/aid/24337/fid/175

16. -click button 'Next'

17. -click button 'Finish'

18. -This will add a unit (=IMapQuest1) to your form

19. -add a frame to your form

     1. select from menu option 'File'

     2. -select from list 'New'

     3. select from list 'Form'

20. -Call the first frame 'FromAddress'

21. -Call the second frame 'ToAddress'

22. -put 4 labeled editboxes on it (palette 'Additional')

23. -put a rich edit box on it

24. -put the frame on the form, by using the frame selector

     1. Click first on the form (to give it focus)

     2. palette 'Standard'

     3. double click on 'Frame'

     4. then select that frame (e.g. 'Frame 2' from the list

     5. This will put it on your form

25. -again put this frame on the form, using the same
     steps (via double clicking on the frame selector,
     and again selecting that same frame)

    Advantage of using the frame
    when you give that frame focus (by clicking
    on its body), all the frames on the form
    will follow its movements (e.g. enlarging that
    frame) simultaneously

26. -put a button on the form

27. -double click on the button and type the text

procedure TForm1.Button1Click(Sender: TObject);
begin
 RichEdit1.Lines.Text :=
 GetImapQuest().GetDirections(
   FromAddress.LabeledEdit1.Text,
   FromAddress.LabeledEdit2.Text,
   FromAddress.LabeledEdit3.Text,
   FromAddress.LabeledEdit4.Text,
   ToAddress.LabeledEdit1.Text,
   ToAddress.LabeledEdit2.Text,
   ToAddress.LabeledEdit3.Text,
   ToAddress.LabeledEdit4.Text
  )
end;

26. Run your program

26. Fill in the origin and destination information in the editboxes:

     e.g. in FromAddress.LabeledEdit2
          fill in

           Scotts Valley

          in FromAddress.LabeledEdit3

          fill in

           New York


27. Click on the button

28. Then you will see a screen similar to the following:

----------------------------------------------------------------------+
New York, NY US Scotts Valley, CA                                     |
                                                                      |
US 1. Start out going Northwest on CHAMBERS ST toward CHURCH ST. 0.17 |
miles                                                                 |
                                                                      |
2. Turn RIGHT onto HUDSON ST. 0.57 miles                              |
                                                                      |
                                                                      |
3. Turn SLIGHT RIGHT onto HOLLAND TUNNEL/ HUDSON ST. 0.06 miles       |
                                                                      |
4. Stay straight to go onto HOLLAND TUNNEL/ HUDSON ST. Continue to    |
follow HOLLAND TUNNEL. 1.85 miles                                     |
                                                                      |
5. Turn SLIGHT LEFT onto BOYLE PLZ/ 14TH ST. Continue to follow 14TH  |
ST. 0.26 miles                                                        |
                                                                      |
6. 14TH ST becomes US-1 & 9 S/ US-9 S. 1.28 miles                     |
                                                                      |
7. Take the US-1-TRUCK/ US-9-TRUCK exit toward I-280/ JERSEY CITY/    |
KEARNY. 0.19 miles                                                    |
                                                                      |
8. Turn SLIGHT RIGHT onto US-1 & 9 TRUCK S/ US-1 TRUCK S/ US-9 TRUCK S|
0.36 miles                                                            |
                                                                      |
9. Turn SLIGHT RIGHT onto NEWARK AVE. 0.32 miles                      |
                                                                      |
10. NEWARK AVE becomes NEWARK & JERSEY CITY TURNPIKE. 2.26 miles      |
                                                                      |
11. Merge onto I-280 W. 16.61 miles                                   |
                                                                      |
12. Take the I-80 W exit on the left toward DOVER/ DEL WATER GAP. 0.47|
miles                                                                 |
                                                                      |
13. Merge onto I-80 EXPRESS LN W. 2.27 miles                          |
                                                                      |
14. I-80 EXPRESS LN W becomes I-80 W (Portions toll). 2135.97 miles   |
                                                                      |
15. Take the I-215 exit- exit number 130- toward LAS VEGAS/ RENO/     |
S.L.C. INT'L AIRPORT. 0.67 miles                                      |
                                                                      |
16. Take the exit toward SALT LAKE. 0.06 miles                        |
                                                                      |
17. Merge onto I-215 N. 1.31 miles                                    |
                                                                      |
18. I-215 N becomes I-80 W. 3.70 miles                                |
                                                                      |
19. Merge onto I-15 N via the exit- on the left- toward RENO/ SALT    |
LAKE/ 2100 SO/ 1300 SO/ 900 SO. 3.54 miles                            |
                                                                      |
20. Merge onto I-80 W via exit number 311 toward RENO/ S.L. INT'L     |
AIRPORT. 693.67 miles                                                 |
                                                                      |
21. Merge onto I-680 S toward BENICIA/ SAN JOSE. 58.25 miles          |
                                                                      |
22. Take the MISSION BLVD WEST exit toward I-880/ WARM SPRINGS        |
DISTRICT/ UC EXTENSION. 0.47 miles                                    |
                                                                      |
23. Merge onto MISSION BLVD/ CA-262 W. 0.81 miles                     |
                                                                      |
24. Merge onto I-880 S toward SAN JOSE. 12.77 miles                   |
                                                                      |
25. I-880 S becomes CA-17 S. 20.83 miles                              |
                                                                      |
26. Take the SCOTTS VALLEY DR exit toward GRANITE CREEK RD. 0.20 miles|
                                                                      |
27. Turn LEFT onto SCOTTS VALLEY DR. 0.93 miles                       |
----------------------------------------------------------------------+

----------------------------------------------------------------------