Link to home
Start Free TrialLog in
Avatar of starhu
starhu

asked on

How to make Api for Delphi application

Hello,

I have never done such a thing before.
I am thinking of creating of an API interface for my applications written in Delphi.

I am interested in the following:
1.How can I make an api for my Delphi application
2.What are the areas I can use the Api for (at first I thought of data import and export but I am sure there are other useful areas as well)
Avatar of Frozenice
Frozenice
Flag of Philippines image

what will the API will serve?

you can make your delphi application a WSDL server.... frm here it will generate
an api where external application can talk to and exchange request..

Avatar of Emmanuel PASQUIER
that is a strange question :
usually, someone wants to do something and asks how to do it and/or if some idea would serve the purpose.
YOU have the desire to use some generic technique and are asking how you could use it with your application (2) and precisely which brand of this generic technique you should use (1).

And of course, all that without telling us what your application is doing. There are dozens of dozens of API technology, usage, with pro and cons for each, without a single one better than all on all counts.
There are many possibilites. For example you can easy expand your application to Automation Server.

Other possibility is moving required functionality to separate DLL and you can both use this DLL in your application and document DLL's function for use by external applications.
It will depend largely on the type of application it is.

  If you wrote something akin to MS Word then you would have a GUI application that would be limited in the type of API it could use (A web service would probably be out).  In this case I would probably go with a COM object.  This is coming from someone with many years of experience developing in Windows.  IF you need your application to be cross platform then the solution would likely become much more complicated.

  If the application is a web page, and you want developers to be able to use the functionality of the web site (without needing to use the web pages themselves), then you could easily base your web page on a web service type of API, allowing other developers to access it.

  If the application handles things in a background manner and you want other applications on the same machine (or across a network) to be able to access these pieces of functionality then a service may be what you are looking for (think SQL Server, or any database server, as an example of this type of functionality).

I hope this helps you to quantify what we, as the experts trying to help, would need to understand of your project.
Avatar of starhu
starhu

ASKER

Ok, I will clarify this.

I have many business softwares as stock softwares, ERP, CRM etc.

Many people ask me how to connect other business softwares to my softwares. They ask if I can give them an Api specification so their softwares and my softwares can work together as "one".

The idea is if 10 different softwares need to be connected to my software that I don't need to make 10 different contact points but only one which I give to the developers of other companies and they can connect no matter if the other is an invoice system ,a bidding system or a webshop.

Thank you
What do you mean by connect :
a - 'simple' data exchange (in ? out ?)
b - or complex 'functions' calls of your software from others ?

for a), what is your kind of data, do you use a database that can be queried ? maybe you could implement an XML bridge ?
for b) maybe you could create WebServices API

your explanations are better than nothing, but you really should detail the kind of relationship between your softwares and others
Avatar of starhu

ASKER

I need a: simple data exchange both in and out.
I use different databases mostly MySql (but all of them can be queried)

I don't know anything about XML bridge.
 Normally I would do a web service for this type of thing.  If you need to allow other software to... log in... keep a list of stock symbols for their account... do a query to get a list of historic stock data... WHATEVER...  You can make the web service handle several individual calls to perform the various tasks.  Each web service call will have it's own parameters and results.  If you pass a user name and password to a web service (use https to encrypt it) then you could return a session ID that would be a required parameter to use any of the other web service calls.  This would enforce the software using your web service to log in for access.  If the other software makes a call to get a historic list of data for stocks, they would pass the session ID and... a parameter to specify which stocks (blank could be interpreted as all).  I would make the result of the call a string containing XML that could be used by the client software to create a dataset on their end to allow them to see the data.

  I say all of this as examples.  When you do a web service, there are many languages that can read the Web Service Description Language (WSDL) file to enable their code to call your web service.  Doing a web service means that your application would need to run on (or as) a web server.  If you do not want this to be part of your design, you could try to do it as a COM object and have the same functionality (limited to running on Windows).  If all programs accessing your data need to do so concurrently then it should be handled as a single central server (once again indicating something like a web service).  If it is handled as COM then it becomes a COM object running on a server that is accessed by other computers via DCOM.

  Delphi is capable of creating ISAPI DLLs that can be run on a web server.  There are, as the old adage goes, "many ways to skin a cat".  We still do not have much information to go on to help you define your user interface.  You need to determine 1) exactly what capabilities you want to expose 2) what platforms you want to support 3) what technologies you can use to meet those goals and 4) which technology you want to implement from the list.  There is no single right answer to this type of question.  My own experience tells me to let the needs define the implementation.  That is impossible to do without the list of needs...

One more try at guiding you to the details required...
ASKER CERTIFIED SOLUTION
Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial