Soap client framework - spring

I have web application on Spring MVC and looking for SOAP consumer - frameworks to be used with Spring MVC. The web app is only the consumer and doesn't host any web service.
Options I am looking for SOAP client are :
1. JAX-WS
2. Spring MVC & Spring-WS
3. Apache Axis or CXF
4. Spring Integration or Camel. Can these be used for consumption of
services too? Won't that be overhead?
What do you suggest? Please recommend the best option if also not in the above list.
Thanks in advance.

Look at this excellent post about this subject.
Which framework is better CXF or Spring-WS?
My advise based on the fact that you only have to develop one client, is to consider making your choice based on your context to optimize your productivity and avoid adding tones of layer and libs in your app:
Pure Java EE app or already using Spring APP
Your current Application Server : Jboss for example already provide a CXF implementation that is very suggested to use
Service providers "age": I have met some problems in calling AS400 or old IBM system webservices. Any client was not working.
Your IDE and Plugins : for example, if you have eclipse, Axis/CXF plugins are very interesting.
Concerning Camel, it is interesting if you have different source and destination like HTTP to JMS.
For Camel, read this post:
What exactly is Apache Camel?

Related

WebSphere 9.0 Jersey Sample Application

I am looking for sample RESTFull application, that can be deployed in Webpshere Application Server 9.x. Posting here with great hope after exhaustive search. Any help much appreciated
There are many samples, here you have two, they are for WebSphere Liberty, but the main concepts and code is the same:
OpenLiberty /sample-restful-webservice
Creating a RESTful web service
There is no need to use Jersey, just use JAX-RS api provided by container.

Does Apache Camel replace or complement creating micro-services with Spring Boot?

I have been working for a while with Spring micro-services and have no come across Apache Camel as a tool for building micro-services. I'm unclear -- is Apache Camel a replacement for creating micro-sevices with Spring Boot or does it add functionality / short-cuts to developing such services with Spring Boot? It's already fairly simple to create microservices with Spring Boot so it's hard to imagine what Apache Camel would add but that is the essence of my question.
Apache Camel has nothing to do with microservices.
It's an implementation of the Enterprise Integration Patterns: https://www.enterpriseintegrationpatterns.com/
Apache Camel provides an implementation for most of the patterns from the book from Gregor Hohpe and Bobby Woolf. Plus a variety of inbound and outbound endpoints to integrate with systems like the file system, FTP, HTTP, Messaging, Facebook etc.
Find more information on the website: https://camel.apache.org/
There is a Spring Boot Starter project to run Camel in a Spring Boot application:
https://camel.apache.org/spring-boot.html
what Apache Camel would add, that is the essence of my question
In service of declaring REST based microservices, Camel's REST DSL provides a fluent API for declaring microservices. Take for example:
rest("/books").produces("application/json")
.get().outType(Book[].class)
.to("bean:bookService?method=getBooks(${header.bookCategory})")
Should tell you at a glance that requests to the path /books will get you a List of Book, as long as you send a request parameter named bookCategory. This is mapped to a POJO bean called bookService.
Spring Boot is a framework which simplifies application packing and startup while Spring is the actual framework which has libraries for performing various tasks.
Technically, we can use Camel for building micro-services as well and many aspects of camel depend on Spring. If you foresee many integration related functionality like sending email or communicating with other system, you can use also use Hexagonal architecture.

What's the difference between application vs service frameworks?

I'm reading tutorial for Apache CXF and I see one of the samples is using Spring framework. Looking at the following example I don't understand how it is different from just using Spring (it seems CXF doesn't add any add'l functionality?) http://cxf.apache.org/docs/writing-a-service-with-spring.html
Apache CXF is a Services Framework which can be used to create web services and support JAX-RS/JAX-WS/SAAJ etc (various specifications for developing Web Services).
From there documentation they support the following:
Multiple Transports, Protocol Bindings, Data Bindings, and Formats
Transports: HTTP, Servlet, JMS, In-VM and many others via the Camel transport for CXF such as SMTP/POP3, TCP and Jabber
Protocol Bindings:SOAP, REST/HTTP, pure XML Data bindings: JAXB 2.x, Aegis, Apache XMLBeans, Service Data Objects (SDO), JiBX
Formats: XML Textual, JSON,FastInfoset
Extensibility API allows additional bindings for CXF, enabling additional message format support such as CORBA/IIOP
Where as Spring is an Application Framework and supports
IOC Container / DI Framework
MVC Framework (Web Applications and Web Services support)
Data/JPA wrappers etc
To make your enterprise application creation experience smooth.

Plain Servlet vs Spring MVC

I have to create a web application, I need to use my back-end code for mobile apps also.
I know Servlet, I thought of doing this application with "REST API" + HIBERNATE for server side and Javascript(Angular JS ) in UI.
Some of my colleagues suggest to do this with Spring. I don't know anything about Spring. While reading about Spring I came to know that back-end logic and UI code can be in same place. It seems it is tightly coupled with back-end and front-end.
Some times back Jquery is more preferable JS framework but now everyone suggests Angular JS. This will be changed after some times. But logic I am going to write in back-end will be the same.
How can I choose the correct one?
I suggest to use:
Spring web MVC for backend https://spring.io/guides/gs/serving-web-content/, maybe with Spring Boot, and Hibernate for DAO layer. Here you can find a helpful example (without Spring Boot): http://websystique.com/springmvc/spring-mvc-4-and-spring-security-4-integration-example/
and for frontend certainly Angular 2, with TypeScript, instead of Angular js, and here reach the REST service exposed by backend.
These days it is easy to build a REST based back end with no libraries at all if you deploy to a Java EE 6/7 server such as WildFly, TomEE or Payara (amongst others).
You get JAX-RS and JSON-P (for rest), JPA for persistence, web sockets, asynchronous processing, transaction management and the rest of the Java EE stack for free.
Try a google search for Java EE thin war - there's lots of examples about

why we use jersey with spring? What are the benefits?

I want to know that why we use jersey with spring and what are the benefits of using it.
I have searched on google but not getting proper answer so i am asking this question here.Sorry because i know my question is old but i am very confused now.
Please suggest me the example of jersey with spring and hibernate.
Thanx in advance.
I use Jersey2 with Spring in one of my projects and in the other Spring MVC4. The advantage of Jersey is its simplicity. If you are creating only RESTful Web services - use Jersey, if you have to generate also some web pages for users, consider to use Spring MVC.
Additionally, I develop my applications on Google Cloud, so the warm up time is very important (if there is a traffic spike, many instances have to wake up in the background to be ready for incoming requests) - according to my tests Jersey is a bit faster than MVC.
Here you have an example of complete configuration:
Integrating Jersey 2 and Spring with Java Based Configuration

Resources