Java REST Web Service or .Net Web API - java

I want to develop a web service.Out of Java web service and .Net Web API which should I select.
.My requirement is that it should be stable and should be effective in performance.Which should bare load of thousands of requests and won't fail.Out of this two which should I choose and why?

My suggestion would be implement Rest WS in Java, Since it's platform independent, rich API's, you can go with Spring for rapid development.

My suggestion is Java. I'm used to Java to build REST server that serve thousands request and it's still working well.
The Jersey is good framework for you. Also Java is open source and independent platform.

Related

NodeJS and Java to create REST API

My company currently has a Java project that allows us to run jobs to process data. The current project has a web interface, but its rather old, and most of the web interface is implemented through Java Servlets by printing HTML out to the web browser.
We want to instead create a REST API using the same core process, and replace the web interface with a different implementation in the future. Then eventually, we may have customers use the REST API.
My question is this: I understand NodeJS is pretty powerful, and from what I've read, makes the most sense when developing a REST API with the JavaScript and JSON integration. Should I attempt to create the REST API with Java, and if so, should I use JavaEE and Glass Fish, or should I have the API be built with NodeJS, then have the NodeJS server call the core Java service to process the requests?
I understand I may be introducing unnecessary complexity, however the project is rather large, and it won't be feasible to port the project over to NodeJS. I don't have experience with REST API creation (or SOAP), so this is new territory for me.
Thanks for the help,
Colby
Your aim is to create REST API so that your customer could use the API.
For this you can use :
NodeJS to create all your complete application code and Rest API.
There are plenty of
Java is good to create Rest API. You can use JEE and server you are comfortable with. For example, GlassFish.
My suggestions : Use Java because your current application is on Java. You could save time because working on same language. You already have skills in Java languages. You can use Spring framework ( Spring MVC, Spring Security and Spring Boot). Theses frameworks offer some great features and are simple to learn.
Since your current application is already in Java, based on Servlets, the easiest way to create a REST API is just to use the JAX-RS API in your current application. You can start with this JAX-RS tutorial. You would probably also want to use JSON-P for converting between Java objects and JSON. GlassFish, Payara, or any other application server should already provide both the API out of the box.
If you want to use plain servlet container, such as Tomcat, you can add Jersey library to our application, which provides a servlet to support the JAX-RS API in the same way. Or you can alternatively use Spring REST to build the REST API.
I don't recommend to use Node.js just for the REST API - it would introduce a new language for a thing, which can just as easily be done with Java, which is already used by your application. In the end, you would still need to connect the additional Node.js application with the current Java app, which is cumbersome. You would probably end up creating a REST interface between the Node.js app and the Java app, making the Node.js app redundant.

use java and .net in same project

I am trying to develop a small project in college. My team mates want to go for Java technology while I am more interested in .net.
Is it possible to develop the web site using Java and then redirecting it to .net(asp.net,which is our final module)?
So that I can work on .net module while letting my friends work on Java. Summing it up, Is it possible to develop the project(web site) using java and .net both(in the same project)? I googled it but didnt found anything relevant.
can you please help.
Develop your website using HTML and JavaScript, may be you can use libraries like jQuery etc. For Back end develop web services. Because Web Services could be implemented in any language. You can change the underlaying language without breaking the website.
If there is a split in deciding technologies, you can break the project into modules. Now you can find a few modules which can be exposed as web services. So you can create webservices in whichever language you wish. This way you get to learn both the technologies and also get to learn more about webservices.
Few Useful links
Calling .net webservice from JAVA
Webservices: Introduction
When not to use webservice
IMHO just because as a team you cannot decide which technology to use, you should not jump into using webservices. They should only be used after proper evaluation and analysis. You might end up putting lot more effort than you planned.

Integrating .NET application with Java/J2EE app via web services

Assume we have a .NET application that exposes its web services. This app needs to be integrated with our J2EE application running on Weblogic. Both are internal applications so we don't worry too much about security.
There are no really complex data structures/types so we should be able to map them between .NET and Java tier (or at least write adapters on the Java tier to ensure the match).
What is the best approach of consuming these .NET web services in the J2EE application?
The simple approach would be to just generate WSDLs for the .NET web services, and generate Java client classes using wsdl2java or other similar tool and see if that can work without adapters/changes, create unit tests, etc. But in case of data related challenges we may need to deal with XSD/Schemas, generating classes, etc.
I know there is WSIT to deal with interoperability issues, but want to keep this as simple as possible. Any thoughts, ideas?
You could connect the two applications with a RESTful API. This lets them talk in a shared, high level API over HTTP. Both languages have plenty of support for both creating and using HTTP/RESTful services, so this should be fairly simple to implement in either language.

Best RIA tools for a Java backend

I've written a java server side application with many classes and EJB's that do things like output RSS information and update a database. I also have a web service connection thorugh SOAP and some basic servlets and xhtml pages that do very simple display of some of the infomration.
What I need now is advice on what a good Java centric approach to building a rich client side experience, and RIA that connected to the server side functionality I've created.
I'm using Glassfish 3.1, and JEE6. I'm considering Java Server Faces but it's more of a framework for developing simple webpages. What I want is a javascript heavy application that runs in the browser, is very graphical with animations and can connect to the services I've created underneath probably through websockets.
I want all of the AJAX, and Javascript support you would expect from a modern RIA experience.
What Java technologies will get me there. Or am I leaving the Java sphear and entering something else. I'm just trying to stay with java as long as possible for this application as an experiment of Java's abilities. So what Java tools are out there for RIA and integrated JavaScript?
Thank you,
For Java definitely the Google Web Toolkit.
You could also look at Vaadin. Unfortunately there isn't really
a good SOAP client for JavaScript but if you had a JSON REST webservice
and are willing to develop in JavaScript I also recommended
to look at frameworks like ExtJS, JavaScriptMVC or Backbone.js.

Web services creation and consumption

I'd like to learn how to create a java web service that can be consumed by a web tier, which is constituted of java and flex.
What books can help me learn how to create a java web service and consume it via java & flex?
Should I look to build a web service from scratch or from frameworks like: XFire, Axis, CXF, Spring Web Services, etc.?
If using a framework is recommended, which of the above or any others makes the most sense to learn/use?
EDIT:
Both the java AND flex components of the web tier need to independently access the web service. For example, the flex component helps the user create & save a spreadsheet; the java component retrieves the spreadsheet data and displays it accordingly.
Flex should do the job: Web Services with Flex tutorial
You may not need a web service. Your Flex app can consume Java POJOs directly using Spring and BlazeDS.
What kind of a service are we looking at? If it requires database integration you probably need at least some kind of a framework - you really don't want to be putting your SQL queries hard coded into the app. Spring + Hibernate seems to be one of the most popular choices for a Java server implementation, but both of them are quite massive and require some effort. Appfuse could be something that provides a good starting point for building a service.
Why do you want to do your service with Java anyway? Is this because you know only Java or because there is a Java container already running on your server? I've seen great results with Ruby on Rails too and now there's some buzz about Scala too in the Java world. This could be your chance to try out something new and more flexible ;)
I'll take this opportunity to plug my own book, Eclipse Web Tools Platform: Developing Java Web Applications. Chapter 10 deals exclusively with creating Java Web services. Although the examples are all shown using WTP tooling the lessons discuss Java Web services created with Apache Axis.

Categories