php soap有关问题 跪求高手解答…

WBOY
Libérer: 2016-06-13 13:44:34
original
992 Les gens l'ont consulté

php soap问题 跪求高手解答……!!
server端:

PHP code
<!--

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();

?>
Copier après la connexion


client端:
PHP code
<!--

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;
}
?>
Copier après la connexion


为啥客户端运行时会报错:Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in D:\PHPWeb\php webservice\client.php:6 Stack trace: #0 [internal function]: SoapClient->__doRequest('__call('sayhello', Array) #2 D:\PHPWeb\php webservice\client.php(6): SoapClient->sayhello('Jim') #3 {main} thrown in D:\PHPWeb\php webservice\client.php on line 6

用try catch 后 得到这个:
fault code:HTTP
fault string : Not Found
  还有 能不能给我详细介绍下soapserver 跟soapclient方法里的那个array参数到底是怎么用的啊 ??  
求高人帮助!!!

------解决方案--------------------
server端有个wsdl文件,怎么没有?
Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!