Communication between Ruby on Rails 3 Web application and C++ Desktop application - c++

According to my requirement I need to provide a communication between a Desktop application developed on C++(QT Framework) and Web application developing on Rails 3.
The requirement is, User can able to upload/download files from Desktop application to Rails application. These files I need to save in live database.
For this requirement, I'm planning to develop an API(Possibly Web Service). First of all is it possible to complete this requirement through Web Services using SOAP/WSDL/REST.
Please let me know the different ways to achieve this.
Thanks,
Kalyan

Rails provides a really nice way of developing an API with it's supported REST protocol. This way you can easy develop a web front end while essentially completing the API at the same time, this way your desktop application can communicate via the API.
As long as you keep your code DRY(Don't Repeat Yourself), your API can co-exist within your same web project. This way you don't have two separate code projects to maintain. This will help with consistency.

Related

Creating web service first than website or vice versa

I am planning to build an application bundle that includes a mobile app, a website and an web service for other developers. Website has the first priority and mobil application has second.
For creating the mobile application ordinarily first i need to create the web service.
What is the way i should follow:
Create web service, than website and mobile application using it.
Create website, than create service and mobile application.
P.S: I will develop the service and website using Scala and Play! Framework
The optimal order will vary depending on priorities and how stable requirements are.
Usually during development, the understanding of the problem improves and the requirements change. This can happen particularly for the user interface. The first usability tests can lead to changes in the application's design and behavior.
A construction order that takes this into account would be:
Create an initial version of the website. Depending on the project this would include a short description of the project, a way to collect emails, and authentication features such as user registration and login.
Create the mobile application, mocking the service layer in the mobile application itself (i.e. using mock service proxy objects). The objective is to discover and stabilize user interface requirements. This process will clarify which services are needed, which operations these services must perform, and exactly which data these operations must receive and provide.
Implement the web service, based on the already stabilized requirements.
Complete the web site, including description of the application's features and benefits, and showing the application's content (e.g. screenshots, videos).
This order assumes the application's features are the main benefit of the project. If, on the other hand, the main value and complexity resides in the web service, and the application is just a thin, optional front-end over it, then it might be more appropriate to develop the web services first and then the application.

When to use standalone web service approach

I just started learning web services. In bottom up approach, I have found some examples without being deployed in any application server. I mean a standalone web service application.
Here is an example of such type.
I have also given a try and done a walk-through of deployable simple web service examples.
So far to my learning of web services, I got to know that firstly, bottom-up- approach is not recommended. Now, in bottom-up approach, this standalone web service. When is it applicable to follow standalone web service procedure?
Endpoint.publish();
I guess, this approach is provided just for beginners and not to follow as a real-time practice. Is my interpretation correct?
I would make my application as a standalone web service if it will have multiple clients like:
Web Client via a web browser
Mobile App Client
Desktop Client
Then I could build every one of them alone using whatever the technology I prefer, and make it consumes my standalone web service.
For example, You could imagine the guys behind Twitter started developing it by building their core system as web service, then they build an independent web interface application for it, then they built the Twitter Android and iPhone APP, and another one came and introduced a Twitter Desktop client like Tweetbot and TweetDeck ... etc

webservice application in Demandware

I need to develope WAS application and should be hosted into Demandware platform. Can i develop the WAS application using tomcat and can host it into the Demandware or should WAS application be developed in the Demandware platform?
I am new to Demanware platform and WAS. Guide me.
You cannot build a web service outside of the UX Studio paradigm like what you described, but you can build a psuedo-service like pipeline in UX Studio that returns JSON, XML, etc. and it will work more or less just like any other REST service.
Demandware is Software as a Service (SaaS) provider, which will not allow you to access the underlying infrastructure (e.g. Tomcat server, Oracle DB, etc.) to make/install your custom extensions.
UPDATE (25.09.2015):
Currently Demandware are making extensions to their controllers, migrating from pipeleine-based controllers to script based ones. Chances are that at some point they may even introduce an API for creating web-services.
Until this happens, your only option is to make some custom pipelines and utilize something like XML/JSON over HTTP for this type of functionality. (Or if you insist on having it as SOAP based service, you would need to parse the SOAP envelopes with explicit code)
Demandware platform is a proprietary technology which allows developing only using their sandboxes and own IDE "UX Studio". All this stuff is available for demandware developers on their xchange portal. Access there could be requested by a merchant you do a development for.
Demandware has the core framework is closed to third parties and is exposed via the Demandware script and REST API's as well as Demandware's own Pipelet system.
Sadly you can't deploy external application in Demandware server, we have to separately create new app in UX studio
You can get the proper help on Demandware Wiki or on Exchange

How to expose desktop application as a Secure Web Service?

The Window desktop application provides C++ API that gives an array of customer information such as name and address. I want to expose this as SOAP Web Service with Security so that authorized clients (from remote servers Linux/Java based through ESB) of this web service can get this information at any time they want in SOA implementation (Java based).
The desktop application does not have a standard database. It stores its data internally. Its basically old custom built CRM application that is installed on each agent's PC box. Each agent has its own list of customers.
What are the steps to achieve this task?
Do I need to run this as Windows service?
The short answer is, yes, you can expose data from a desktop application through a SOAP web service. It is easier to do with C# and .NET, but not impossible to do from C++. What steps you need to take will depend on which platform you are developing for.
Roughly -
Implement an endpoint that supports SSL where clients can connect to your desktop application (using sockets in C++ or HTTPListener using .NET).
Write code that can receive and dispatch SOAP requests.
Handle SOAP requests and return properly formatted SOAP responses.
Handle WSDL requests.
Implement a security mechanism (cookie based or otherwise).
Using .NET, most of this is in the platform code already, you just have to put the pieces together. With C++, you may find some third party libraries but essentially you'll be writing your own.
You only need to implement a windows service if you want the data to be available while a desktop user is not logged in and running your desktop application. The challenge here is that you'll have to make sure the windows service can access the same data the desktop application is using.
Another strategy would be to access the data from your desktop application using the C++ API and Interop and implement the web service as a standard out of the box asmx hosted on IIS.

What's the best way to create a client library for a web service API?

We have web service running for one of our projects. We want to be able to access this web service similar to how you'd access an API (such as Google Data, etc.) where you have client libraries in several languages: .NET, Java, Python, etc.
You'd be able to download these libraries (usually .DLL) from our project's website and then integrate these into your custom application.
The reason we want to have these client libraries is so that we can encrypt certain data transfers between the client and the web service and so that you wouldn't have to login a million times when you want to make a request (like you have to do when using raw SOAP requests).
So, my question is... What's the best way to do this? What would the client libraries contain, other than some encryption and a bunch of methods? What's the best way to create these libraries? Obviously some different platforms are needed to accomplish this (some flavor of Linux, maybe Mac OS), should virtual environments be used?
What are your thoughts? Thanks in advance for your help!
You would first express an API via the web service. What you are then interested in doing is creating a client "wrapper" for your web service API. This is what the client would download and use in their application (similar to Facebook.NET). This would be an assembly project and house a bunch of classes and so on. These classes would maintain the state of the program utilizing the API and would take care of all the low level plumbing work interacting with the web services by exposing a verbose object model that is easy enough for the user of your wrapper to get around in.
You could do this for any language that could interact with your web services. Java, Python, etc. I suggest using WCF though as you can use TCP for the .NET library and standard web services for the other languages. This will help you to be more performance oriented where possible.