the difference between web app and web service - ruby-on-rails

Suppose you want to build a web service/app to manage a PMS (property management system). It contains two resources: room, and guest. You can
* add/remove/edit a room
* add/remove/edit a guest
* assign a guest to a room
1) Can you design and implement it in Ruby on Rails, as a web app?
2) Can you design and implement it in Ruby on Rails as web services? And please describe how you plan to use rspec to test it.
I do not know the difference between web app and web service. Can somebody tell me why?

This is for web app mobile app native app and addmin panel communicate database service
web usually used for remote(this is your central database) ,suppose that you have server and you are hosting web services file 1-> you have need create web services methods (insert update delete query) 2->via server URL with web services methods you can call 3->you can get or post method

Related

Signalr connecting to multiple Web applications

We're planning on adding SignalR to several differnet web applications. The applications are targeted different aspects of an order. When something happens to an order, all users working with the order across all web applications should be notitfied.
Changes to an order are availible asa message on a servicebus.
We could implement the following logic in all web applications:
Subscribe to a topic (one subscription per webapp)
OnMessage -> Send orderId to hub
Hub would notify clients working on the orderId
Question is: Could we implement all this common functionality in a separate application, and all web apps would reference the same signalr scripts?
All applications live on the same domain, and it would give us a lot of benefit not having to implement signalr in every app.
Good idea, or am I missing something important here?
Edit: Put in other words: I have WebAppA, WebAppB and WebAppC all without SignalR. I'm asking if its possible to create a WebappD that talks to clients in WebApp A,B,C
Second Solution is very good. it will move signalr load (espcially memory) from your main web apps to WebAppD(signalr web app). And all your main web apps will not be dependent to signalr.
Drawbacks: You don't have any authentication on WebAppD. Because clients are authenticated on the other WebApps. You should let the WebAppD knows about orderId. That's why, you should send message to server (WebAppD) from clients(Javascript).
Because of enable cross domain settings, anyone can send message to server. Even they don't need to be connected WebAppA,WebAppB or WebAppC. Even if you solve this problem (virtual path etc), Someone is connected but not authenticated on WebAppA,WebAppB,WebAppC can sends message. Because WebAppD just get the message and it doesn't know this client is authenticated or not so it will serve this message to all others. In Short: Someone can send fake messages to other clients.
So you should share your authentication like this (or some other logic) between your web app and signalr webapp.
Other than this I couldn't see any drawback.

Deploying the same site N times

With our company, we sell a service to our customers,
this is a website which let customers enter some parameters and informations, and then, they can query a web service to get
the previous informations computed. These web sites are hosted on our servers.
We would have on our servers one database per client (dbo.Client1, dbo.Client2...) with the same schema.
And we would like to provide a different url for each client :
expl :
www.client1.service.com www.client1.ws.com/compute
www.client2.service.com www.client2.ws.com/compute
But i'm wondering how to deploy easily the web services and the web site?
Do i have to deploy one web service and one website per client (with different web config)?
And maybe create multiple deployment scripts ?
Or is it possible to imagine one instance of each (web service and web site), listening on several addresses, and creating different
connection string according to the entry point of the request (is it even possible with MVC or WCF ?)
Any other idea ?
I don't know what is the best practice here.
Thank you.
if anybody read that question one day, i solve my problem using multi-tenant solution, which allow me to deploy only one instance of the site.
The site handle the webrequest, and according to the host, connect to different database.

integrate quick books data into asp.net application using web connector

• I am using asp.net . I have to integrate quick books data into my asp.net application.
• In silverlight application using com objects am able to connect to QB and getting the data from that By selecting Company name from .
• But I have to do all this stuff from the iis. So using com objects it is not possible to get the data com object.
So I have chosen Web connector.
My requirement is :
I will select the company database from User interface
After that I have to get the data like : customers ,vendors.
That data I have to import into my database.
But using Web Connector : that has different scenario…
I have to select first .qwc file using this we are calling web services. From there we will get the data.
Is it possible to call the web connector through the coding…..calling web service from there…
Or is there any other solutions without selecting .qwc file
Is it possible to call the webconnector through the coding
No, the Web Connector calls your web service, not the other way around.
It can be scheduled to poll your web service every X minutes.
Or is there any other solutions without selecting .qwc file
To use the Web Connector, you go through a one-time setup process of installing the .QWC file. You only have to do that once. After you've done that, there's nothing else necessary on the end-user side of things.

Ruby on Rails application/REST API authentication architecture

I'm going to develop a Ruby on Rails application (basically a back-office) which at the same time will serve data for an Android mobile app via the REST interface Rails provides.
My concerns here are the following: how should I manage and structure my ROR application so that REST calls from Android are authenticated with an API Key + user ID (I was also thinking in using OAuth) and, on the other side, users can interact with via back-office.
Should I use for example different controllers for the same resources (thus, increasing complexity) for BO accesses and Mobile client accesses (so I can implement different auth logic)?
Is there any standard/common way (aka gem) to manage and implement this behavior?
Thanks in advance!

Reference web api from a different project

I am developing a MVC app. I want to develop some web api's so i can use them from other projects.
Can this be done as currently when i do create a web api project it creates all the controllers and views etc.
Also would this be the place where you setup the types e.g. contact type which contains all the objects for a contact e.g. name, address etc.
Just need to get it right before i get my head into it.
Thanks
You could perfectly fine define your Web API controllers (deriving from ApiController) inside separate projects (class libraries). The Web API is normally RESTFul and Web API controllers don't return views. They return models which are normally XML or JSON serialized. You could even host the Web API outside of an ASP.NET application in its own host which could be a Windows service or Console application for example. You don't even need IIS. The following article described a self hosting scenario.
As far as the consuming client side is concerned, that could be absolutely any kind of application ranging from desktop application to another ASP.NET site. The client application could use the native HttpClient class to consume the WEB API or any other HTTP capable client such as WebClient or even HttpWebRequest. The client could even be written on some other non .NET platform. All that is required is the capacity to send HTTP requests.

Resources