Rest service architecture - web-services

I've just completed the "Getting Started with RESTful Web Services" tutorial on NetBeans. So basically, I created a restful service from a database and deployed it, ready for a client to consume.No frameworks or anything were used. A Web Application was created and a rest service from a database was added to it.
Edit: I've also created a very basic Javascript client with a GUI that can access the service.
My question is, what architecture is this project using? It's a RESTful, but is it using MVC/MVVM etc.? How would you describe the architecture within the service?

Related

authentication through web service SonarQube

I'm working on a web application that highly requires SonarQube (version 5.3) Web Services.
I want to authenticate to the sonarqube instance using my application.
which web service should I use?
Another question :
While using the issues web service I noticed that the web service returns the issues of the last project analysed by sonar.
Is there a way to have the issues of all the projects or to have the issues of a given project?

Web application as a client for web service

I am new to Web development. And hence, if the question is dumb, please be polite. For creating my application, I had to take a decision of whether writing a web service or a web application. After searching a few questions in stackoverflow, I came to know that, web service is something which doesn't involve human interaction. And web application is what human uses ( the UI/web page kind of stuffs ).
But lately, I saw gmail is a web service ( email service ). But I was confused from here on, because, gmail provides a UI, and human interactions do occur. And from there on, I got confused again.
So what I figured out from this is, gmail website is like a web application for users to use directly. The web application in turn uses the web service provided by Google for email. Is my understanding right? So can a web application be a client for web service?
If I am wrong somewhere, please do correct me. I hope to be clear after someone throws light on this with some good example. Thanks in advance.
You are quite right. Basically a Web Service has several endpoints over HTTP (normally) that provides data (generally in JSON or XML) and are meant to be consumed by Web Clients. Sometimes the are also called Web API's (Application Program Interface).
A Web Application is quite similar to a Web Service but it provides an interface where the user can interact with. Usually Web Applications are consumers of Web Services or Web APIs.
Following your example, Google email is could be considered as both, a Web Service and a Web Application. It is a Web Service because it provides a set of HTTP endpoints that works independently of its Web UI Application (GMail). In fact, you can find third party Web Apps that interact with the Google email Web API.
This concept is very important when designing Web Solutions. Ideally you want to design and implement a good Web API, usually a RESTful Service (in JSON/XML). Then you or others will be able to implement different types of applications (Web, Mobile, etc.) because of this API.

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

API centric application or REST or Web service Where to start

BRIEF:
I am working on a web application, we decide to make some major. We did some researches and we found this tutorial that talks about "Creating api centric application".
we found the topic is very useful to us as we need in the near future to make an android app.
WE STARTED WITH:
Doing some searches starting from this query "api centric application" and we found these two topics related to that query:
REST
WEB SERVICE
WHAT WE WANT TO KNOW:
What is the difference between these terms "API centric application", "REST", "Web Service"
Is Rest an alternative way of Web service?
Is API Centric Application an approach of REST?
Is Web Service the parent of all this terms?
Do i need to produce some other information in order to this question
be eligible for policy.
After study all these types i found that:
A Web Service is a type of API, and all web-services must be API but not all API's must be web-services, The REST is a new concept of writing web-services and Web services written by apply REST Architectural concept are called RESTful web services
So my focus will be on changing my application to be API centric application by using REST Web service as this practice

Web Service on Netbeans

I have created a Web Service in Net Beans 6.9 and deploy it locally. And I am using it via a java SE application by adding Web Service client in this application. How to obtain the link of the Web Serice so that it can be used from anywhere ?
2) From where to obtain WSDL file of Web Service ?
3) How to host a Web Service on the internet ?
Thank a ton in advance..!!!
You could create a new project of type web application in Netbeans.
In the web application, you will then create a web service (NOT a web service client).
For publishing and testing the web application, you will have to deploy it to a web server (e.g. GlassFish).
After publishing the web application, the WSDL file will be typically located at: http://localhost:<port>/<your web app>/<your service>?wsdl
For GlassFish, the default port is 8080.
If your current Netbeans installation doesn't support web projects or you don't have GlassFish installed, I suggest you download and install the latest version of Netbeans with Java EE support (bundled Apache Tomcat and GlassFish server in the same setup).
http://netbeans.org/downloads/index.html
Hosting SOAP web services on the internet at large has not been terribly successful. For example Google had SOAP based web services initially, and they switched to REST based services in the end. You may want to reconsider and deploy a REST based interface. If the bulk of your code is not embedded in the web service, then you should not have that difficult of a time switching the interface.
To deploy a SOAP or a REST web service, you would need to deploy a 'full' Java EE container (e.g. Glassfissh or JBoss) on a machine with access to the internet. You might virtual hosting e.g. Westhost, Amazon, or there are turnkey solutions like Heroku (note: I'm not endorsing any of the companies listed here; they're just examples). If you just want to deploy a REST based service, any web container will do e.g. Tomcat or Jetty. In addition to services mentioned above you could probably host a rest web service on any service that will let you upload a war file.