Chapter 2. The Basics of Web Services

As with any programming language, architecture, or standard, you must become familiar with a lot of terminology before you can start implementing anything. So I'll start by introducing some of the basic terminology and technologies you need to understand before coding your own web service clients and servers. Don't worry: I'm not going to go back to ground zero and explain XML. Nor am I going to give you a blow-by-blow description of what's in a WSDL document.

Probably the most important thing to cover is the idea of web service signatures. Web service signatures are really just data types that the service either expects or returns. Web services are not language-specific: you can use your programming language of choice to implement a client or a server. A client written in C# or Java must be able to communicate with a client written in Ruby, and vice versa. One consequence of this is that, to be compatible with strongly typed languages like Java, web services must also be strongly typed. For the most part, the object types you are likely to come across in web services are things you would expect: integers, strings, booleans, floats, and datetime types. However, web services often deal with more complex types as well, such as arrays and structures. From a Ruby point of view, dealing with all these different data types is really quite simple. All the standard data types basically map to their Ruby counterparts, arrays map to Ruby Arrays, and ...

Get Web Services on Rails now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.