I have a spring based project that need Rest API support for developing Rest client. This is a very high load application and I need a Rest implementation that with good performance. I've found in many article like one here that CXF is a great performance wise but initial effort in configuration and POC seems to be to much. Haven't found a lot of documentation regarding the API usage.
Can any one suggest weather I should use spring or CXF.
You should also try Restlet and Jersey. By doing some demo projects with each one of them, you can find out which one best suit you.
Related
We have a application which works with MySql database.
Now we are implementing mobile version of our application and I'm looking for java solution for easy generating rest services from already ready sql queries.
Details on security and performance:
Security is required (LDAP).
Performance - working time of rest request should be approximately equals working time of sql request.
What solutions can be used for it?
I think the best solution is REST4Enterprise
also can take a look on and restSQL
I suggest using spring roo very easy to use
I recommend using netbeans to generate rest webservices from database tables.
Netbeans also offers the ability to generate REST webservices from entity beans (JPA entities).
Have a look at this link.
If you are looking for just CRUD REST services - one of the above tools suggested by others can help.
But for something more check - Dropwizard
my 2c
For Mobile applications, REST is the best recommended architecture. But you have to ensure the session handling at the client side (recommended).
Eclipse -> Webservice -->Create a Sample Rest Webservice will be a good starting point
You can use spring-rest or grails to develop rest services.
Consider doing web services in PHP. No need for anything other than Tomcat, and offers LDAP verification. It is very quick time to market, and PHP works with MySql pretty seamlessly.
You can give a look at Developing REST Web Services Tutorial.. not sure if it's the best solution but could be one... I used it twice and found it usefull and really easy.
In the Java™ world, you can build a RESTful web service in several ways: Some folks use JSR 311(JAX-RS) and its reference implementation Jersey, others use the Restlet framework, and some might even implement from scratch. Spring framework for building Java EE applications, also supports REST in its MVC layer.
http://www.ibm.com/developerworks/webservices/library/wa-spring3webserv/index.html
Below article also covers RESTful web services api using java and mysql
http://www.9lessons.info/2012/09/restful-web-services-api-using-java-and.html
im using spring MVC and webflow to create a game server and serve some web pages to the users. Thing is, the javascript game will also make multiple ajax calls to restful services on the same server for some game logic. While the web page serving performance is not critical, the restful service calls need to be as efficient as possible (efficient as in response time).
For performance of the services, would it be better to use pure JAX-RS (jersey) web service calls without the spring ws overhead (since i understand the spring layer could affect performances negatively) or would it be the same if i used the spring webservices framework instead and maintain integration with the rest of the spring family?
thanks!
There aren't many clear benchmarks out there, but take a look here:
http://www.techempower.com/benchmarks/
It clearly shows the overhead of using Spring. Compared to Servlets that serve JSON manually Spring is "slower". Personally, I don't think that Spring cuts development time, unless you are very much familiar with it. Creating a simple servlet that will act as a REST API is very simple. Take a look at the servlet code from the benchmark:
Servlet benchmark
I don't think Spring per se will affect performance negatively. Where did you hear that?
Spring web services are "contract first" SOAP services. If you're saying that you don't want to pay the overhead of SOAP, XML, marshalling and unmarshalling, then you have a valid point. That's true whether you use Spring to implement the services or not.
REST is HTTP, so it's a natural for AJAX calls.
I believe Spring 3.0 supports REST, so it's not a "Spring or not Spring" choice:
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/new-in-3.html#d0e1188
I am new to consuming web services. I am trying to consume a SOAP service. This is currently in the test environment. What I have done is
Use wsdl2java to generate a wsdl that I have copied to my domain folder.
Use the API to send requests and receive responses.
What concerns me is do I need CXF or Spring WS to wire the service or is what I have sufficient. I am asking this because I have seen elsewhere like
What I don't get is where I would generate property when environments are switching from development to QA to production. And do I need to use CXF or Spring WS or are the annotated classes (#WebServiceClient sufficient) to consume the SOAP service. Basically, how to connect to different endpoints.
I apologize if this is rudimentary question. Thanks.
Spring-WS and Apache CXF are primarily useful for creating web-services. They are alternative web service implementations to the one that ships with Java6.
You can use them for writing clients, but there's not really much point, unless you're really keen on the alternative API that those provide.
The standard JAX-WS artifacts generated by wsdl2java should be perfectly sufficient for what you need.
As for your second question regarding how to target different prod/QA endpoints, you should ask a separate question for that, with full examples of what you have.
I am required to build couple of Java WebServices on JBoss 5.x. One of the services will be consumed by a WPF Application. I am quite new to the world of WebServices and researching more on that. Needed to know if someone has been through the same and can share the pointers on how to achieve it.
I am reading one of the articles on JBoss Communities: http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch12.html
I am not sure if web services explained here are interoperable with my WPF Client. I am planning to use WCF to consume these web services.
Can anyone share some pointers about it?
Thanks!
WCF can consume SOAP web services as well as RESTful ones. I recommend looking into JAX-RS for REST, and/or JAX-WS for SOAP. Both JAX-RS and JAX-WS are APIs that let you create web services by annotating Java code, rather than having to work with XML configuration files.
These days, SOAP is often considered over-engineered, and REST is considered leaner. There are a ton of questions comparing the two on SO.
I've been at this for a little while and my mind has gone to mush.
I'm wondering if anyone can help me out here. I'm trying to make a Java Web Service (using its own HTTP server and not something like tomcat), that supports Metro and Jersey. This way a client can connect to the web service anyway they want whether it is SOAP or REST.
I've got the metro part down so it can support Doc/Lit wsdls and RPC/lit wsdls but I've having some difficultly understanding the Jersey part so it will support REST/xml and REST/json
Also the idea is that there would be one class where all the endpoint methods are written in and other classes would extend it.
Has anyone used these two combined before? Can you point me the direction of a decent article or do you have an example yourself?
Thanks
Metro is a implementaion of JAX-WS used mainly for WSDL/SOAP based webservices.
Jesery is a implementation of JAX-RS used maily for Restful based webservices.
I have used both in the same project but for different purposes. You can also use apache httpclient for restful services, but jersery provides lot of useful annotations for converting to json, xml etc. Hope it helps.
I am a bit confused about what you mean when you say you want to support Jersey. Jersey is an implementation of JAX-RS (JSR-311). Do you mean you want to support JAX-RS?