Latest News

    • Web Services Architecture – When to Use SOAP vs REST

      SOAP (Simple Object Access Protocol) and REST (Representation State Transfer) are popular with developers working on system integration based projects. Software architects will design the application from various perspectives and also decides, based on various reasons, which approach to take to expose new API to third party applications. As a software architect, it is good practice to involve your development team lead during system architecture process.   This article, based on my experience, will discuss when to use SOAP or REST web services to expose your API to third party clients.   Web Services Demystified Web services are part of the Services Oriented Architecture. Web services are used as the model for process decomposition and assembly. I have been involved in discussion where there were some misconception between web services and web API.   The W3C defines a Web Service generally as:   A software system designed to support interoperable machine-to-machine interaction over a network.   Web API also known as Server-Side Web API is a programmatic interface to a defined request-response message system, typically expressed in JSON or XML, which is exposed via the web – most commonly by means of an HTTP-based web server. (extracted from Wikipedia)   Based on the above definition, one can insinuate when SOAP should be used instead of REST and vice-versa but it is not as simple as it looks. We can agree that Web Services are not the same as Web API. Accessing an image over the web is not calling a web service but retrieving a web resources using is Universal Resource Identifier. HTML has a well-defined standard approach to serving resources to clients and does not require the use of web service in order to fulfill their request.   Why Use REST over SOAP Developers are passionate people. Let's briefly analyze some of the reasons they mentioned when considering REST over SOAP:   REST is easier than SOAP I'm not sure what developers refer to when they argue that REST is easier than SOAP. Based on my experience, depending on the requirement, developing REST services can quickly become very complex just as any other SOA projects. What is your service abstracting from the client? What is the level of security required? Is your service a long running asynchronous process? And many other requirements will increase the level of complexity. Testability: apparently it easier to test RESTFul web services than their SOAP counter parts. This is only partially true; for simple REST services, developers only have to point their browser to the service endpoints and a result would be returned in the response. But what happens once you need to add the HTTP headers and passing of tokens, parameters validation… This is still testable but chances are you will require a plugin for your browser in order to test those features. If a plugin is required then the ease of testing is exactly the same as using SOAPUI for testing SOAP based services.   RESTFul Web Services serves JSON that is faster to parse than XML This so called "benefit" is related to consuming web services in a browser. RESTFul web services can also serve XML and any MIME type that you desire. This article is not focused on discussing JSON vs XML; and I wouldn't write any separate article on the topic. JSON relates to JavaScript and as JS is very closed to the web, as in providing interaction on the web with HTML and CSS, most developers automatically assumes that it also linked to interacting with RESTFul web services. If you didn't know before, I'm sure that you can guess that RESTFul web services are language agnostic. Regarding the speed in processing the XML markup as opposed to JSON, a performance test conducted by David Lead, Lead Engineer at MarkLogic Inc, find out to be a myth.   REST is built for the Web Well this is true according to Roy Fielding dissertation; after all he is credited with the creation of REST style architecture. REST, unlike SOAP, uses the underlying technology for transport and communication between clients and servers. The architecture style is optimized for the modern web architecture. The web has outgrown is initial requirements and this can be seen through HTML5 and web sockets standardization. The web has become a platform on its own right, maybe WebOS. Some applications will require server-side state saving such as financial applications to e-commerce.   Caching When using REST over HTTP, it will utilize the features available in HTTP such as caching, security in terms of TLS and authentication. Architects know that dynamic resources should not be cached. Let's discuss this with an example; we have a RESTFul web service to serve us some stock quotes when provided with a stock ticker. Stock quotes changes per milliseconds, if we make a request for BARC (Barclays Bank), there is a chance that the quote that we have receive a minute ago would be different in two minutes. This shows that we cannot always use the caching features implemented in the protocol. HTTP Caching be useful in client requests of static content but if the caching feature of HTTP is not enough for your requirements, then you should also evaluate SOAP as you will be building your own cache either way not relying on the protocol.   HTTP Verb Binding HTTP verb binding is supposedly a feature worth discussing when comparing REST vs SOAP. Much of public facing API referred to as RESTFul are more REST-like and do not implement all HTTP verb in the manner they are supposed to. For example; when creating new resources, most developers use POST instead of PUT. Even deleting resources are sent through POST request instead of DELETE.   SOAP also defines a binding to the HTTP protocol. When binding to HTTP, all SOAP requests are sent through POST request.   Security Security is never mentioned when discussing the benefits of REST over SOAP. Two simples security is provided on the HTTP protocol layer such as basic authentication and communication encryption through TLS. SOAP security is well standardized through WS-SECURITY. HTTP is not secured, as seen in the news all the time, therefore web services relying on the protocol needs to implement their own rigorous security. Security goes beyond simple authentication and confidentiality, and also includes authorization and integrity. When it comes to ease of implementation, I believe that SOAP is that at the forefront.   Conclusion This was meant to be a short blog post but it seems we got to passionate about the subject.   I accept that there are many other factors to consider when choosing SOAP vs REST but I will over simplify it here. For machine-to-machine communications such as business processing with BPEL, transaction security and integrity, I suggest using SOAP. SOAP binding to HTTP is possible and XML parsing is not noticeably slower than JSON on the browser. For building public facing API, REST is not the undisputed champion. Consider the actual application requirements and evaluate the benefits. People would say that REST protocol agnostic and work on anything that has URI is beside the point. According to its creator, REST was conceived for the evolution of the web. Most so-called RESTFul web services available on the internet are more truly REST-like as they do not follow the principle of the architectural style. One good thing about working with REST is that application do not need a service contract a la SOAP (WSDL). WADL was never standardized and I do not believe that developers would implement it. I remember looking for Twitter WADL to integrate it.   I will leave you to make your own conclusion. There is so much I can write in a blog post. Feel free to leave any comments to keep the discussion going.

Thursday, 12 March 2009

10 things to know about me ... Confession of a great mind

Like everyone else, I usually get asked, What, Where, When and How, much about myself. In this blog entry, I will use a Question and Answer format (FAQ – Frequently asked questions) to give interested parties more knowledge about myself.

1. Who is Armel Nene?

Well that’s an obvious one. My name is Armel (French name), I was born in the Ivory Coast and raised in France. I am a native French speaker. I moved to London when I was 15 and been residing there since.

2. This is a technology blog, what technology do you use?

I am a passionate of technology in general; from getting the latest hardware to trying the hottest programming language on the market. I started getting into technology from a young age therefore I subsequently using a vast array of technologies.

2.1 In terms of programming language, which language do you use on a daily basis?

I am a JAVA dude. I use the language daily to work on different type of projects; J2ME for mobile applications, J2EE for enterprise and even getting to grasp with JAVAFX. When I sit in front of the PC, it is because I am trying to develop some new prototype applications or finishing some work related projects.

2.2 are you a geek?

Do I look like one? No! I am not a geek and I am not in denial

2.3 ok so do you have any of the following:

PC and Laptop? Yes.

Blackberry or iPhone? Both.

Wii, Xbox or PS3? All.

Do you have a home network? Yes.

Do you like computer films such hackers and pirates of Silicon Valley? Hmmm. I got both films so what is your point? That does not make me a geek.

3. Microsoft or Apple? Bill or Steve?

Microsoft! Mac is for secretaries, the hardware is fashionable but it lacks a large number of software that I use on a daily basis. Also Bill over Steve, you have to watch Pirates of Silicon Valley movie to understand the reason for my choice.

4. What is the last book that you’ve read?

Tsun Tsu - Art of War. This is one of the best book written. I am currently reading “48 Laws of Power” which is similar to the art of war.

5. Are you a risk taker?

Well, I like risk if there is a great reward that comes out of it. I perceive risks as challenges and they are present with the sole purpose of being taken on. The mind needs challenges in order to keep active and learn. Don’t forget, we learn from our mistakes and experiences and than from others. Taking risk shows a degree of confidence in your own abilities, and well planned and undertook challenge will make you a better person.

6. You talk about learning and challenges, what is the most recent challenge that you have undertaken?

I am currently studying an MBA in IT Management. I think this is great challenge as all my life; I have only been involved in pure technology such as Software development. I did not feel a sense of satisfaction as I felt that there is no much left in programming that I cannot do. I ran team and projects in the past and my development skills are reached the expert level. So I wanted to learn something new, I want to understand why managers and companies always act like they do.

6.1 What are you going to do after your MBA, a change of career path?

Well that is a very good question. I love technology and I love developing application. After my MBA, I am planning into moving on the management stuff of IT. I want to build team and or companies to build great software. I want to be able to use my theoretical knowledge to penetrate market or take opportunities of niche markets. A lot of IT guys leave in the dark like the “IT Crowd” and might be happy with they have but I need to feel part of the bigger picture. After all this, I am still an avid software developer and I think I will still be developing for the next 20 years either as part of my work or as a hobby.

7. Do you read other blogs?

Techrunch.com and lifehacker.com, TechCrunch is more about technology start-ups venture in contrast to Lifehacker which is about “pimping” your hardware.

8. Which day is your favourite day of the week?

I am sure that most of the planet population would agree with me that Friday is the best day of the week as it is the start of the weekend.

9. What do you when you bored?

I live by the Thames River so I usually take my family for a day out or I meet friends. If it is raining, then I spend my time on the PC looking for my next challenge.

10. What is the last movie you watched?

Watchmen! I found it over hype and too long but I would watch it again.

10.1 What is that in cinema or you downloaded it?

What kind of question is this? Don’t you that this blog is available all over the Internet? Of course I watched the movies in cinema, do you want my receipt?



Ok now we are done is there anything you want to add?

No. I was getting bored and I got a program to finish so that I can put it for download on the Apple App Store.

You are a geek..

No, I am not. You are a nerd.

  • Blogger Comments
  • Facebook Comments

0 comments :

Post a Comment

Item Reviewed: 10 things to know about me ... Confession of a great mind Description: Rating: 5 Reviewed By: Unknown