Check that you have the SDO extension loaded - PHP Info |
Extract the examples into the root of your Web server eg. C:\Program Files\Apache Group\Apache2\htdocs. All the examples are contained in the examples directory, e.g. C:\Program Files\Apache Group\Apache2\htdocs\examples. A number of samples are provided, which illustrate different aspects of the Service Component Architecture. For example, how to call SCA components from a PHP script or another SCA Component, how to expose SCA components as Web services, how to consume them as a Web service, and so on. |
ScriptCallingLocalSCAComponent |
HelloClient.php - PHP script: This script gets a proxy to the local SCA component (HelloService.php), and calls its sayHello() method, passing in the name 'Bertie'. HelloService.php - local SCA component: This component implements one method, sayHello($name), which takes in a name and returns the string "Hello $name". |
SCAComponentCallingLocalSCAComponent |
HelloClient.php - PHP script: This script gets a proxy to a local SCA Component (SurnameService.php), and calls its sayHello() method, passing in the name 'Bertie'. SurnameService.php - local SCA component: This component implements one method sayHello($name) which takes in a name, adds the surname 'Beetle', and calls the sayHello() method on the local SCA component HelloService.php, passing in the new name. HelloService.php - local SCA component: This component implements one method sayHello($name) which takes in a name and returns the string 'Hello $name'. |
ScriptCallingRemoteSCAComponent |
HelloClient.php - PHP script: This script calls a remote SCA Component (HelloService.php) to cause it to generate its WSDL definition. It then gets a proxy to the remote SCA Component and calls its sayHello() method, passing in the name 'Freddie'. Note: The default location used for calling the service is http://localhost/examples/SCA/Soap/ScriptCallingRemoteSCAComponent/*.php. Please edit this location in HelloClient.php to point to the correct location in your environment if necessary, for example to add a port number. HelloService.php - remote SCA component: This component implements one method, sayHello($name), which takes in a name and returns the string 'Hello $name'. It makes itself available as a Web service using the @binding.soap annotation. |
SCAComponentCallingRemoteSCAComponent |
HelloClient.php - PHP script: This script gets a proxy to a local SCA Component (SurnameService.php), and calls its sayHello() method, passing in the name 'Freddie'. Note: The default location used for calling the service is http://localhost/examples/SCA/Soap/SCAComponentCallingRemoteSCAComponent/*.php. Please edit this location in HelloClient.php to point to the correct location in your environment if necessary, for example to add a port number. SurnameService.php - local SCA component: This component implements one method sayHello($name) which takes in a name, adds the surname 'Fish', and calls the sayHello() method on the remote SCA component HelloService.php, passing in the new name. HelloService.php - remote SCA component: This component implements one method sayHello($name) which takes in a name and returns the string 'Hello $name'. |
SCAComponentUsingDataStructures |
HelloClient.php - PHP script: This script gets a proxy to the local SCA Component (SurnameService.php), and calls its sayHello() method, passing in a list of names. Note: The default location used for calling the service is http://localhost/examples/SCA/Soap/SCAComponentUsingDataStructures/*.php. Please edit this location in HelloClient.php to point to the correct location in your environment if necessary, for example to add a port number. BatchService.php - remote SCA component: This component implement one method sayHello($names) which takes in a Service Data Object containing a number of names, and returns a new Service Data Object of the same format containing the string 'Hello $name' for each name. names.xsd - data structure schema: This file is a simple XML Schema containing one complex type, called 'people'. This contains a many-valued element called 'name' for holding the names of people. |
MailApplicationClient |
TestClient.php |
Runs a script which calls a component locally, then the same component via the xmlrpc binding. The results should be the same, of course, but note the rounding errors in the floating point return. |
Orders |
Orders.php |
Just following a link to Orders.php will send a GET and drive an enumerate and return XML |
Orders.php/order2 |
Following a link to Orders.php/order2 will drive a GET for just orders2 |
The other methods require HTTP POST, PUT and DELETE and cannot be driven just by following links. |
OrdersClient |
A page that uses HTTP verbs to drive an SCA component as above, but that component drives another SCA component using the restresource binding. It will behave like the first example. |
test contact feed |
Runs a script which drives create, retrieve, update and delete against an atom feed. |
See the contents of the feed in the browser |
Just fetch the contents and let the browser format it using the "xoxo" microformat. |
A PHP script calling classes | helloworld.php is a PHP script which calls two local classes - no SCA at all |
Using getService to get local proxies | Helloworld is a PHP script which gets two local proxies to local components |
A component with a rest-rpc binding calls local components | helloworld.php is an SCA component with a rest-rpc binding. This gets two local proxies as above. The web page invokes helloworld with a POST. |
Generate WSDL for the "Greeting" soap service | Generating WSDL |
Generate WSDL for the "Reversing" soap service | Generating WSDL |
Using getService to get soap proxies | Helloworld is a script which gets two soap web service proxies |
A component with a rest-rpc binding calls remote soap services | Helloworld.php is an SCA component with a rest-rpc binding. This gets two soap web service proxies as above. The web page invokes helloworld with a POST. |
As above but using SDO to pass data | Complex types and REST binding |
Generate an SMD | Generating a JSON-RPC Service Method Description |
Generating EmailService WSDL | Automatic WSDL generation |
Email with ws SCA service binding | PHP script locally accessing SCA Service |
Email with ws SCA service and reference binding | An SCA service accessing another SCA service |
Generate ContactService SMD | Automatic SMD Generation |
Email with SDOs | Complex types. Note this sample is written to work with DB2. Create a datable called email and apply contacts.sql before running |