Rumah > Artikel > pembangunan bahagian belakang > php soap有关问题 跪求高手解答…
php soap问题 跪求高手解答……!!
server端:
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><?php error_reporting(7); $server=new SoapServer(null,array('uri'=>"http://test-rui")); function sayhello($str) { return "Hello ".$str; } $server->addFunction('sayhello'); $server->handle(); ?>
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><?php error_reporting(7); try{ $client=new SoapClient(null,array('location'=>"http://localhost/php webservice/server.php",'uri'=>"http://test-rui")); $client->sayhello("Jim"); } catch (SoapFault $fault){ echo "fault code:".$fault->faultcode."<br>". "fault string : ".$fault->faultstring; } ?>