!!!概要 PHP5以降はPHPにSOAPを使う機能がある。 それ以前はPEAR::SOAPを使う。 !!!PHP SOAP !!サーバ 注意:handle前にhtmlなどのレスポンスをすると動作しない。 'http://localhost/test'); $server=new SoapServer(NULL,$options); $server->setClass('MySoapServer'); $server->handle(); ?> !!クライアント 'http://xxx.xxx.xxx.xxx/server.php', 'uri' => 'http://localhost/test' ); $client=new SoapClient(NULL,$options); echo $client->getMessage(); //Hello,World! echo $client->addNumbers(3,5); // 8 ?> !!!PEAR::SOAP http://codezine.jp/article/detail/199 http://isopan.blog.fc2.com/blog-entry-21.html !!サーバ addToMap('getMethod', array(), array()); $server->service($HTTP_RAW_POST_DATA); ?> !!クライアント 20); //リクエストするメソッド名を記述 $result = $client->call('getMethod', $params, $options); //出力結果 hello123world echo $result; ?> {{category2 プログラミング言語,PHP}}