PHP JSDL generator and HTTP handler

The JSDL download contains two classes: A web service class (WebServiceBase) which handles the web service operation calls and a JSDL generator (JsdlGenerator) which generates the JSON which describes the web service. The JSDL generator is called with the "jsdl" operation: SampleService.php?operation=jsdl

A sample web service implementation can be found here:
https://jsdl.svn.codeplex.com/svn/-%20Generators/PHP/SampleService.php

And its (automatically generated) JSDL definition here:
http://rsuter.com/Services/Jsdl/SampleService.php?operation=jsdl&pretty=true

Installation:
Copy all files from https://jsdl.svn.codeplex.com/svn/-%20Generators/PHP to a directory on the web server.

The JSDL is accessible with "SampleService.php?operation=jsdl"

PHP attributes:
  • @jsdlIgnore attribute: The method is not exposed as web service operation
  • @role attribute: The method is only called if the user is in the defined role. The WebServiceBase class automatically calls the (virtual) isUserInRole method to check whether the user is in the required role. If the user is not in the requested role, a JSDL exception is transmitted to the web service client.
  • @returnType attribute: Defines the return type as JSON Schema

Last edited Jul 31, 2013 at 12:10 PM by rsuter, version 16

Comments

No comments yet.