Howto: Creating a Soap Service
SOAP (Simple Object Access Protocol) is a protocol used for developing web-services. A web-service, as its name implies, is a service that is accessible via the internet. The classic example is the stock quote web-service: you provide it a company symbol, and it responds with the current price of the stock.
Web services are powerful in that they have the ability to tie together disparate systems. It is possible for a COBOL/Unix machine to communicate with a C#/Intel box so long as both speak SOAP.
I have chosen to use SOAP internally on cubanlinks.org in order to faciliate communication between code I’ve written in Java and PHP. You might be asking: why not just write your application in one language or the other? Two reasons:
- PHP does some things better than Java, and vice versa.
- Re-writing my PHP code in Java is time-consuming.
So, let’s examine my SOAP service. I used Dietrich Ayala’s soapx4 implementation for PHP. The version I used had very limited support complex data types, but since then has been much improved.
More to come ….