Book Image

Java EE 7 Development with WildFly

Book Image

Java EE 7 Development with WildFly

Overview of this book

Table of Contents (21 chapters)
Java EE 7 Development with WildFly
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Choosing between SOAP and REST services


The choice of adopting SOAP rather than REST depends on your application's requirements. SOAP web services are exposed using their own well-defined protocol and focus on exposing pieces of application logic as services. So if your requirement is to consume business services that are exposed using a well-defined and negotiated contract (between the service consumer and service provider), SOAP web services are a perfect match.

On the other hand, if you need to access some server resources using stateless HTTP invocations and as little as possible of the navigation bar of your browser, you should probably go with RESTful web services.

That being said, there may still be some scenarios that could fit both the options, and you are free to choose whichever web service suits your requirements the best. Recently, REST has gained popularity, thanks to its interoperability. We use only the HTTP protocol and JSON, which almost every language can handle. Therefore...