This preview shows page 475 - 477 out of 619 pages.
So, when the call came in, it seemed I’d be a natural fit for what the client was looking toaccomplish. Once I understood what they really needed, though, I decided that theywould be much better off with a set of services exposed through simple GET and POSTrequests over HTTP, exchanging XML data describing the requests and responses.Although I didn’t know it at the time, this architectural style is now commonly referred toasREST, orRepresentational State Transfer.How did I decide to use REST over SOAP? Here are a few of the decision points to considerwhen choosing a Web Services architecture:How many different systems will require access to these services, and are all of them known at thistime?This manufacturer knew of a single distributor that needed to access its systems, butalso acknowledged that others might decide to do the same in the future.
I N T E G R A T I N G B U S I N E S S P A R T N E R S T H E R E S T F U L W A Y453Do you have a tight set of end users that will have advance knowledge of these services, or do theseservices need to be self-describing for anonymous users to automatically connect to?Because there has to be a defined relationship between the manufacturer and all its dis-tributors, it is guaranteed that each of the potential users will have advance knowledgeof how to access the manufacturer’s systems.What kind of state needs to be maintained throughout a single transaction? Will one request dependon the results of a previous one?In our case, each transaction will consist of a single request and a corresponding resultthat doesn’t depend on anything else.Answering the above questions for this project yielded the obvious choice of simply expos-ing a set of known services over the HTTP protocol and exchanging data using a standarde-business protocol that both systems could understand. If the manufacturer would haveliked to allow anonymous users to query product availability, then I might have opted fora full SOAP solution because that would allow systems to discover the services and pro-grammatically interface with them without prior knowledge of the systems.I currently work in the field of bioinformatics, where there is a definite need for SOAP-style Web Service architectures. We make use of a project called BioMoby (.biomoby.org) to define Web Services and publish them to a central repository that allowsother groups to literally drag and drop our services into a workflow that builds data pipe-lines to help biologists integrate diverse sets of data and perform varied analysis on theresults. This is a perfect example of why someone would choose SOAP over REST. Anony-mous users can access our data and tools without any prior knowledge that they evenexisted.