Heart Internet UK でホストされているサーバーに次のコードを書きました。
// Pull in the NuSOAP code
require_once('./lib/nusoap.php');
// Create the server instance
$debug = 1;
$server = new soap_server;
// Register the method to exposes
$server->register('hello');
// Define the method as a PHP function
function hello($name) {
return 'sucess ' . $name;
}
// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
exit();
その後、これを使用してこれを呼び出そうとすると
$siteurl = get_option('siteurl');
$siteurl = $siteurl.'/wp-content/plugins/soapserverfortest.php';
@$client = new nusoap_client($siteurl);
// Call the SOAP method
@$result = $client->call('hello', array('name' => 'cubet'));
// Display the result
return $result;
結果が得られません。
ハートインターネットに問い合わせたところ、
問題は、soap テストがループバック接続を使用しようとしている可能性があります。これは、ポート 80 を介して同じサーバーとの間で接続しています。
この種の接続は、セキュリティとパフォーマンスの両方の理由から、サーバーでブロックされています
この問題を解決する方法を教えてください。
ありがとう