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

Learn More

Create a SOAP Server, a SOAP Client and SoapFault handlers [soapserver and soapclient]

432 Runs 1636 Views 565 Copies
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

<?php
/*
 * PHP SOAP - Create a SOAP Server, a SOAP Client and SoapFault handlers
 */

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

}
//when in non-wsdl mode the uri option must be specified
$options=array('uri'=>'http://localhost/');
//create a new SOAP server
$server = new SoapServer(NULL,$options);
//attach the API class to the SOAP Server
$server->setClass('MyAPI');
//start the SOAP requests handler
$server->handle();
?>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).