java – what is spring web services used for

java – what is spring web services used for

Your question is really about web services. For a laymans explanation of what it is all about, read this Wikipedia article.

There are a number of related acronyms that get bandied about:

  • SOAP (Simple Object Access Protocol) is a protocol for sending requests to a service and getting back a response. The messages are encoded in XML, and send over HTTP.

  • WSDL (Web Services Description Language) is a service description language for SOAP-based services. It does things like specify what is in the messages, and how the messages are bound to services.

  • SOA (Service Oriented Architecture) is essentially a system architecture in which the system consists of lots of SOAP services (and others) described using WSDL.

(The proponents of SOA talk about design principles, but in my cynical view is that this is just a repackaging / recasting of stuff that people have been doing for 20+ years under other names.)

Do i really need it for ecommerce site

Ask your customers. Ask the people whose systems your system will be interfacing with. Ask the vendors whose components you intend to embed in your system.

If you have to use WS then what extra facility it will give

If you have to use WS (e.g. because your site needs to talk to other services that require WS), then you have to. That is sufficient justification.

If you dont have to use WS, then you need to balance the advantages of using WSDL + SOAP against the advantages of some other approach to implementing your web APIs. An SOA expert will probably say use SOA; an AJAX expert will probably say otherwise. And there are other remote procedure call technologies around … if you really need that kind of thing.

WSDL + SOAP certainly does have some advantages; e.g.

  • machine readable specifications for your web APIs,
  • possibility of validation of messages against XML schemas,
  • an ecosystem of existing WSDL services,
  • adoption in some sectors of IT.

But it has downsides also; e.g.

  • WSDL + SOAP have a significant learning curve compared to some alternatives,
  • XML is a heavy-weight encoding scheme – relatively expensive to parse,
  • SOAP only pretends to be type-safe (compared with say CORBA / IIOP),
  • SOAP is not usually used* in browser-based clients; JSON or plain XML are commonly used for AJAX apps,
  • many people think SOA is over-hyped and steer clear.

* However, it can be used; read these IBM DeveloperWorks Articles.

My advice (FWIW) if your system is primarily a website, doesnt need to talk to SOAP services, and doesnt need to provide a SOAP service API for others …. dont bother. You can always add SOAP service APIs later if you need to.

Spring Web Services is a product of the Spring community focused on creating document-driven Web services. Spring Web Services aims to facilitate contract-first SOAP service development, allowing for the creation of flexible web services using one of the many ways to manipulate XML payloads.

More here : Spring Web Services

How to use Spring Web Service : Spring WS

java – what is spring web services used for

If you dont know what Web Services are, you probably dont need them. Web Services are a way (speaking generally here) for one web application to talk to another. You can formulate a request as an xml document and send that xml to a web service, which is listening on a specific URL and port. The Web Service can then perform some action based on this document, and respond back with an XML document. Its commonly used as a means for integration between applications.

If youre building a simple e-commerce site, which does not integrate with other live web products, then likely you dont need Web Services. Spring Web Services is simply an API/library to make reading/writing web services easy.

Leave a Reply

Your email address will not be published. Required fields are marked *