Home  >  Article  >  Backend Development  >  Example sharing of PHP publishing WebService

Example sharing of PHP publishing WebService

小云云
小云云Original
2018-03-19 14:04:242466browse

Web service is a platform-independent, low-coupling, self-contained, programmable web-based application. This article mainly shares with you examples of PHP publishing WebService, hoping to help everyone.

//发布WebService
soap_defencoding = 'UTF-8';
    $server->decode_utf8 = false;
    $server->xml_encoding = 'UTF-8';
    $server->configureWSDL('mysoapServer');//打开wsdl支持
    $server->register( 'ssoRegister',    //方法名
    		        array("unixname"=>"xsd:string"),
			array("return"=>"xsd:string"));
    //isset 检测变量是否设置
    $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
    //service 处理客户端输入的数据
    $server->service($HTTP_RAW_POST_DATA);
?>
soap_defencoding = 'UTF-8';
    $client->decode_utf8 = false;
    $client->xml_encoding = 'UTF-8';

    $paras=array('unixname'=>'dyh');
    $checkResult=$client->call('ssoRegister',$paras);

?>

Note: Please click to open the link to download the nusoap.php file

Related recommendations:

JS and WebService large file upload code sharing

Detailed explanation of Nodejs calling WebService

Detailed explanation of php creating and calling webservice interface instance

The above is the detailed content of Example sharing of PHP publishing WebService. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn