Publish and call PHPWebservice 1. configure the php environment. ini: remove the semicolon in front of php_soap.dll. Otherwise, the error classsoapservernotfound will be reported, restart apache, and view it through phpinfo (). This indicates that the environment already supports soap webservice, And the next thing is to write code. 2. Publishing webservice
Publishing and calling of PHP Webservice 1. configure the php environment. ini: remove the semicolon in front of php_soap.dll. Otherwise, the class soapserver not found will be reported. Restart apache and run phpinfo () to check whether the environment supports soap webservice, the next thing is to write code. 2. Publishing webservice
Publish and call PHP Webservice
1. Environment Configuration
Configure php. ini and remove the semicolon before php_soap.dll,
Otherwise, an error is reported.
Class soapserver not found
After apache is restarted, use phpinfo () to view
This means that the environment already supports soap webservice, And the next thing is to write code.
2. Publishing webservice
The *. wsdl file released is actually an xml file, which can be generated through the 3rd-party software, such as ZendStudio.
For example, use the following code:
oParams[l1] ; $oParams = json_decode($sParams); $a = $oParams->a; $b = $oParams->b; $c = $a+$b; return array('AddResult'=>$c); }}?>
The generated xml file is:
After an xml file is generated, it must be published through a service, for example:
setClass('CTest');$server->handle();?>
You can then provide the departure address to others or the system, for example:
Http: // 192.168.6.44/webservice/server. php? Wsdl
3. webservice call
Write a call page using the address provided above
Add (array ('oparams '=> $ str); // array // call method 2 // $ pParams-> oParams = $ str; // $ r = $ client->__ call ('add', array ($ pParams); // The object must be var_dump ($ r);?>