NON-WSDL, as the name implies, is a webserver service that does not use WSDL files
In fact, the individual feels that using the WSDL mode is not as good as non-wsdl mode, the WSDL mode is slightly troublesome!
1. Open the SOAP module (php5.0+) in the operating environment of the website
2, the server script, (this time we provide a name to check the ID number of the webserver)
<?php $config = Array ( ' location ' = ' http://127.0.0.1/server.php ', ' uri ' = = ' HTTP://127.0.0.1/ ', ); $soap = new SoapServer (null, $config); $soap->addfunction ("Getcardname"); $soap->handle (); function Getcardname ($name) { switch ($name) {case ' Xiao Li ': return ' 14862014546846564864 '; break; Default: # code ... break; } }? >
3. Client Script
<?php/* * /$config = Array (' Location ' = ' http://127.0.0.1/server.php ', ' uri ' = '/' 127.0.0.1/', ); $soap = new SoapClient (null, $config); Echo $soap->getcardname (' Xiao Li '); >
http://127.0.0.1/client.php, you can see the effect! More complex is to replace the functions in the server with class for more complex permissions control and functionality