-1

I am writing an application that needs to run on Android and on Windows.

How can I receive information from a webservice and and iterate through the data received?

I would like to recieve data from the following webservice: https://api.billysbilling.dk/v1/contacts

Information about the webservice can be found at : https://dev.billysbilling.dk/api/v1/contacts/list

Filipe.Fonseca
  • 321
  • 2
  • 14
user3337132
  • 135
  • 2
  • 6
  • Use an HTTP library, for example Indy's `TIdHTTP` component which comes with Delphi, or choose from many others. – Jerry Dodge Feb 24 '14 at 17:06
  • 1
    As whosrdaddy wrote in a comment, it's JSON, so together with the TIdHTTP use a JSON library to parse the incoming data (Use SuperObject or the built in DBXJSON). For outgoing requests check if you have to use POST or GET requests (I haven't looked). There's plenty of Delphi REST examples on the net where JSON data is handled (https://www.google.com/search?q=delphi+rest+json). – Jan Doggen Feb 24 '14 at 19:02

1 Answers1

3

You can use the WSDL importer of the Delphi.

Go to IDE:

File _> New -> Other -> WSDL Importer

you need put your webservice link this way:

https://api.billysbilling.dk/v1/contacts?wsdl

You put your username and your password, and after you press button next, next and finish.

The IDE going to create the new .pas with the name: "webservice.pas".

You need put the HTTPRIO component and also put the WSDL link above.

You already can use your webservice.

pedro.olimpio
  • 1,478
  • 2
  • 22
  • 43