Speed up development with full-stack environments for every branch.

Learn More

How to create a basic SOAP Server [soapserver and PHP]

1838 Runs 13140 Views 4056 Copies


gtsolutions 373

published 4 years ago

 * PHP SOAP - How to create a basic SOAP Server

//a basic API class
class MyAPI {
    function hello() {
        return "Hello";

//when in non-wsdl mode the uri option must be specified
//create a new SOAP server
$server = new SoapServer(NULL,$options);
//attach the API class to the SOAP Server
//start the SOAP requests handler
//the echo is just for demo purposes, 
//when implementing a SOAP Client no echo must be present otherwise an error will be thrown
echo "SOAP Server started";
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).