OSF Web Services PHP API

The OSF Web Service PHP API is a framework available to PHP developers to help them generate queries to any OSF Web Service endpoint. Each OSF Web Service endpoint has its own WebServiceQuery class in the OSF Web Service PHP API. This class is used to generate any query, to send it to be endpoint of a OSF Web Service instance and to get back a resultset. The resultset can then be manipulated by using the Resultset API. This same API can be used to transform the resultset into different formats.

How to use the API
This API is used to generate OSF Web Service queries to different web service endpoints. This API framework is composed of a series of classes that are used to help PHP developers create OSF Web Service queries in their respective PHP applications.

The use of this API is simple. Developers normally have three easy steps to do:


 * 1) Instantiate the class of the web service they want to query
 * 2) Define all the parameters/features/behaviors of the web service by invoking different methods of the class
 * 3) Send the resulting query using the send method

Here is an example of a query that is generated using the OSF Web Service PHP API and sent to specific OSF Web Service network instance:

The OSF WS PHP API does also support chaining of methods. Here is a chained version of the code above:

Auto-loading of Classes
The OSF Web Service PHP API does comply with the PSR-0 Standard Document for auto-loading the classes of the framework. The SplClassLoader class that has been developed by the same group can be used as the classes auto-loader.

Here is an example of how you can auto-load the classes of the OSF Web Service PHP API framework: