opencart で nusoap Webservice を作成しようとしています。そのために、nusoap ライブラリをダウンロードして system/library/lib にコピーし、このようなチェックアウト モジュールでコントローラ クラスを作成しました。
<?php class ControllerCheckoutCamero extends Controller { public function index() { //require_once('lib/nusoap.php'); $this->load->library('lib/nusoap'); // Create the server instance $server = new soap_server(); // Initialize WSDL support $server->configureWSDL('hellowsdl', 'urn:hellowsdl'); // Register the method to expose $server->register('hello', // method name array('name' => 'xsd:string'), // input parameters array('return' => 'xsd:string'), // output parameters 'urn:hellowsdl', // namespace 'urn:hellowsdl#hello', // soapaction 'rpc', // style 'encoded', // use 'Says hello to the caller' // documentation ); // Define the method as a PHP function function hello($name) { return 'Hello, ' . $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); } } ?>
次に、localhost/myopencart/index.php?route=checkout/camero にアクセスしてコントローラーをチェックしました。
そして、このようなnusoapのデフォルトのWebサービスページを取得します
しかし、そのページの WSDL リンクをクリックすると、opnecart ホームページにリダイレクトされます。
opencart ルーターがこの問題を引き起こしていると思いますが、対処方法がわかりません。opencart の調査を始めたばかりです。ここで同様の質問を見つけましたが、適切な答えが見つかりませんでした。誰かアドバイスをください。前もって感謝します