Spring web service vs Axis2 web service - web-services

My last application had Axis2 web service and used contract last approach. We had a new requirement for creating a web service and I used Spring Web service. A discussion came up in the meeting that why use Spring WS when we already have the required Axis2 libraries to create new web service. I was convincing my team because Spring has Contract first approach which is the best way of creating and all other best points mention in the chapter 2 of the documentation.
But their point was Axis 2 also has contract first.
I would really appreciate anyone since I am really new to web services and still learning what is the difference between Axis 2 and Spring WS. I like an elaborate answer for our better understanding.
Thanks in advance.

If your team already has experience with CXF, and it fits the contract-first requirements, then stick with it.
Spring-WS is simpler and more flexible than CXF, in my experience, but that's not an especially compelling reason to switch to it.

Related

Web Services - What exactly are they?

What does a Web service really mean ? I am not looking for a theoretical explanation, I am looking for something practical.
I was thinking that anything I can call from an external client is a Web service, so a basic PHP which returns JSON data could be a Web service.
But then I started reading about Web services in W3Schools.org and I got confused. If the PHP URL which returns JSON data is a web service, why would I need to do SOAP, WDSL etc ... to create a Web service. Isn't it extra work?
Also, if SOAP is the way data is sent back and forth, what about other transport types?
What differentiates a RESTful Web service from a SOAP based web service?
When you are talking about a webservice people generally misunderstand what it means, a webservice is simply a way to interact between a and b that abstracts the use of local technology standards. A WSDL defines the way in which the SOAP message is being sent over the channel. REST uses JSON over HTTP, WSDL uses SOAP over HTTP.
The advantage of a webservice is, say you develop one piece of code in .net and you wish to use JAVA to consume this code. You can interact directly with the abstracted layer and are unaware of what technology was used to develop the code.
SOA is a set of design paradigms and standards that tell you how to develop your services, in SOA each service is meant to comply with the principles listed below. WSDL is generally linked with but not essential for a SOA solution. If you wish to learn about SOA google "Thomas Erl SOA".
Priciples of SOA
Standardized service contract
Service loose coupling
Service abstraction
Service reusability
Service autonomy
Service statelessness
Service discoverability
Service composability
This Q&A Restful vs Other Web Services brings a lot of light to what is a webserver, and differences from SOAP and REST. Id recommend to read all the answers (many of them are very good).

Axis2 vs JAX-WS

I have to implement SOAP based web services for a project. We are considering different options like axis2, ejb as a web service, jax-ws but not really sure about the advantages/drawbacks of these options. Can someone please help in this regard.
It would be great if someone can point to any other alternatives for implementing SOAP based webservices.
Thanks in advance,
-Csn
For me, the easiest way to expose a web service is creating an EJB with annotations (JAX-WS) if you are using a Java EE server like JBoss.
Consuming a WS is a bit different but I prefer JAX-WS too, because Axis2 throw exceptions if you use complex parameters (classes) and you add an attribute. JAX-WS instead calls every 'get' and 'set' for the serialized xml. If no 'set' is implemented, no problem.
That's an advantage for backward compatibility.
I would highly recommend to use Apache CXF for developing SOAP web services. This stack is based on JAX-WS but has much more features. CXF has an excellent integration with Spring. There are a lot of documentation on the internet how to create web services using this framework. If I would be working on completely new web service I would definitely choose Apache CXF.

Any book on building a complete web service?

Is there any book that can guide me building secure webservices.
Adding xsds to WSDL
Adding WS security policies to WSDL
Any book that can describe how to put together a secure web service.
the language shouldn't matter, but it should explain the concepts and help the reader to put together all the pieces required for building a secure web service.
Thanks
I think the Spring "contract first" web service explanation is excellent.

Web Service to connect to an API and get the response back from the API

This is a general Programming question
I'm new to Java Web services programming using Apache Axis and JAX-RPC.
We need to build 2 components,a App engine (Shopping cart,
Payment Gateway integration etc..) and a UI Control Panel
over an existing API.
The API understands only XML.How we must communicate with the API?
link text
We have been asked to write a Web Service to establish the communication.
Please provide the steps and a Code example/snippet on
how to connect to an existing API through a Webservice and
get the response back from the API to the calling Webservice.
John,I hope I have been able to explain my query.If you have ideas on how to communicate with the API to get the desired result to the user,Please let us know.
We have just started our careers in technology a year back post our
graduation and this project is our very first Java EE project.
You can either develop SOAP, RPC or REST style webservices. Without knowing the problem domain, it is difficult to recommend which one is suitable for you.
If you are just talking about a registration service, the REST style might be the easiest and appropriate one for you. If you don't know what REST, this article might help you.
You can learn some good and bad practices from here. Chooing the right web framework will make your job a lot easier while developing RESTful services. So you might want to look at something like Grails.
Looks like you have already heard of Apache axis. There are nice examples in there on how to build and consume SOAP services.
So decide what exactly you are trying to build, choose the right protocol, choose the right tool and then you will learn as you go.

Standard web services v Secure web services

I ask this question in anticipation as part of a project. I have experience of developing and consuming web services in the past and am au fait with those. However I have been told that as part of this next project I will need to use "secure" web services. Can you provide some insight into what additional development tasks there will be to implement these as opposed to standard dare i say it insecure web services?
Cheers
Unless you have a complex multi-hop scenario, then SSL is vastly more practical and interoperable than anything based on WS-Security or related specification
If your going to be using WCF, check out these guide lines on MSDN
Exising ASMX Web Service can be secured using Web Services Enhancements (WSE) 3.0