Rest webserver using webbroker in BDS2006 - delphi

Could you give me a tip on how can implement a rest webserver using just webbroker?
I know newer versions of delphi has this REST/JSON/DATASNAP features, but i´m stuck with BDS2006.
Basically i need to interact with other application and the guys are asking me to make this webserver application and provide just five methods over the internet/vpn. Don´t need to be running inside IIS or Apache.
I´ve googled a lot but the answers always point to 2010 and up versions. All that readings lead me to use the webappdebug template make some actions and respond to GET/POST/PUT/DELETE with some JSON objects.
The problem is ... I´m not well versed with webbroker, how can i achive this?
THANKS IN ADVANCE, ANY HELP WILL BE WELLCOME.

Our full RESTful Client-Server framework is availble, including an ORM (and much more), named mORMot.
It is an Open Source project, running from Delphi 6 up to XE2 - so it will work with Delphi 2006 (I've tested it with Delphi 7 and 2007 so I do not see any reason why BDS 2006 would fail).
It is able to serve Objects and Services (just like DataSnap) using JSON, in a secured (using per URL authentication) RESTful protocol.
It is able to use any Database engine back-end, with a SQLite3 kernel. You can even use without any database layer at all (that is without SQLite3), if you need only the RESTful services and in-memory objects feature (you can persist the objects with JSON or in binary format, but you won't be able to use advanced features like cross-table search).
More than 700 pages of documentation available.
For HTTP/1.1 communication, it is not based on WebBroker (nor IIS, nor Apache), but it will use directly the high-speed http.sys kernel-mode service.

Related

Authentication silverlight to .NET MVC 5

So my first project at this new company is to convert a silverlight project to HTML5. I get mostly done with it but then in gets down to the nitty gritty. I have a legacy database. I essentially recycled the backend and made a client-side SPA solution using HTML5/CSS/Javascript. I come from an Apple/Linux background, so .NET is super new to me. I have learned that it's generally good to ditch the command line and let windows take control. Either ways, here's the problem. I figured out how to query this Pronto DB, and realized the passwords are hashed as they should be, but the mechanism that encrypted them client side was probably windows/silverlight related and I have to do the same in .NET MVC 5. Would have preferred some newer tech but all we got on the server is .NET 4.5 as the runtime env and it's in the red as far as space on the C drive, so upgrading to better software isn't an option. So basically, can anyone tell me how to tell .NET MVC 5 to reuse my DB for authentication in the same manner that a silverlight app would? Essentially, it's the same concept as how I'm re-using the backend with AJAX, but I imagine some pre-packaged GUI solution for telling windows that it should hash the client password and send it to a legacy DB. Tall order but I know they're some extremely intelligent people out there.

BreezeJS with a Linux backend

I am working on a project where we have a very slim server (Linux, Nginx, Sqlite), but our web application shall not show any signs of shortcomings (should contain charts, dashboards, nice looking controls) – so I need the client to do all the heavy work.
I assume that BreezeJS would be good in this case, because it manages data on the client, in a way that reduces workload on the server. The server only sends the data to the client and at some point gets data back that has to be saved to the database. All caching and other stuff is managed on the client.
I assume AngularJS would also be good in this case, because it is a client-side MVC-framework, again reducing workload on the server. It also works seamlessly together with BreezeJS.
I assume Wijmo would also be good in this case, because it provides nice looking controls and also works seamlessly together with BreezeJS and AngularJS.
Are my assumptions right? Any comments?
My only concerns are how I get BreezeJS to “talk” with the Linux-server (Nginx, Sqlite). Are there any samples regarding this? Is anyone working on something similar?
We will be releasing a NodeJS/Express/Mongo example within the next few weeks that should show how to communicate with an arbitrary non-.NET backend. (also see the current 'Edmunds' example in the Breeze zip). But we don't have anything yet that explicity shows Breeze working with a Linux backend. Please vote for this here: Breeze User Voice

How to add SOAP interface for Delphi Synapse HTTP Server?

I've got a custom HTTP Server created using Delphi 7 and Ararat Synapse which receives HTTP GET from another application with a simple set of variables.
For example: http://myserver.com/get?Variable1=adsds&Variable2=asdasdasdsa&Variable3=aasdsadasdsad
The application source is similar to this - http://searchco.de/codesearch/view/13374072
Now, my customer needs me provide a SOAP interface. Completely new to SOAP, I did some research and found it to be very complicated. I would like to know what's the easier way to incorporate this interface to my HTTP server. Or should I find ready made SOAP To HTTP Conversion app if there is such a software. Thank you.
Note: I'm not the original developer of the HTTP Server.
There is a Web Service Toolkit for Free Pascal and Delphi which can be used to write SOAP servers.
I have not yet used it myself but it is in active development and might be compatible with Synapse.
Update: the current version seems to include support for Internet Direct (Indy) and Synapse (HTTP server and TCP server).
You need to write a SOAP server, which not only generates SOAP responses from SOAP requests, but which also provides a WSDL document telling the users what requests they can make.
Since your completely new to SOAP here are some 'starter' links:
General:
SOAP, WDSL, HTTP, XSD? What the?
List of publicly available web services (I would start writring a small testapp that consumes SOAP)
With Delphi:
Developing Web Services with Delphi
Web Services Made Easy With Delphi
Web services with Delphi
The fact that you are using Delphi 7 makes things more difficult, since later versions have better support:
Debugging/Testing Win32 SOAP Web Services (D2007). Bob has more SOAP articles
For testing both serving and consuming SOAP you should use SoapUI, a great free tool (What is SOAPUI?).
Once you are up to the WDSL you should know what types of WSDL exist and the whole namespaces mess...

Embeding SSRS report viewer in Delphi

Perhaps this question is naive, as I am just starting with ssrs. This is a large Delphi (2009) application that currently uses Crystal (activex) for reports. We are wanting to move to ssrs but would still like to control the report parameters from within our app as we've done with crystal. I've seen the Report Viewer Control for a VS environment and I'd like to do something like that. Any help is appreciated, thanks.
I doubt you can - as far as I know, the ReportViewer control comes in two .NET flavors: one for ASP.NET web applications, and one for Windows Forms .NET apps.
However: you can access all of the reporting server stuff using a simple web browser control, too. SSRS has extensive support for specifying just about anything in the URL, too.
Check out the MSDN docs on Using URL Access from a Windows (Win32) application for a starting point.
Or if you want to take it a step further, the Reporting Services also expose standard web services to do just about anything (including managing SSRS), which you should have no trouble consuming in Delphi as regular SOAP web services.
For that, see the MSDN docs on Using the SOAP API in a Windows Application.

Consuming an ADO.NET Data Service from a WIN32 Delphi application. How?

Simple. I created a LINQ-TO-SQL Entity model, created a website, added a Data Service (*.svc) to this site and made sure it works by writing a simple .NET console application. The service works fine and cannot be modified.
Now I'm going to write a Delphi application (2007) for WIN32 which will have to call this data service. And while Delphi has no major problems importing a SOAP service, it can't import this service since it provides no WSDL...
So, two options. I could figure out how to generate a WSDL based on this data service or I'll have to find another way to consume this service. (Or just give up, but I hate to quit this challenge.) So, any advise?
ADO.NET Data Services are REST services. They are not SOAP WebServices and I don't think REST uses WSDL. You can call REST services from Delphi using HTTP GET/PUT/POST/DELETE. You could use Indy's TIdHTTPClient. See http://msdn.microsoft.com/en-us/library/cc668786.aspx for url examples. The results are in the Atom format, which is a XML format. You could parse it with TXMLDocument. They can also return JSON.
Maybe you can use the project Jedi "url grabber" components to consume the service. I have managed to get live share data using these in the past. I do not know exactly how your setup works, but maybe these can be helpful.
http://www.delphi-jedi.org/
You should also look at synapse, a small easy to use library which works well with REST. The latest version, which can be downloaded via SVN, works well in Delphi 2009.

Resources