テンプレート ページ:
リーリーコントローラーコード:
1 関数 GetPreViewXml() 2 { 3 $client = new SoapClient("http://192.168.1.113/services/CmsService?wsdl"); 4 $funs = 配列( 5 $client->__getFunctions() 6 ); 7 8 $userLogin = new stdClass(); 9 $userLogin->userName = 'admin'; 10 $userLogin->pwd = '5B9BD37AE194BCE2D53666BCB9D99B01'; 11 $userLogin->clientIp = '192.168.1.105'; 12 $userLogin->clientPort = '80'; 13 $userLogin->cmsUrl = 'http://192.168.1.113'; 14 15 $loginResponse = $client->__call("userLogin", array( 16 $userログイン 17 )); 18 19 $getCameraInfoByDeviceInfo = new stdClass(); 20 $getCameraInfoByDeviceInfo->indexCode = 2; 21 $getCameraInfoByDeviceInfo->sessionId = $loginResponse->return->sessionId; 22 $getCameraInfoByDeviceInfoResponse = $client->__call("getCameraInfoByDeviceInfo", array( 23 $デバイス情報でカメラ情報を取得 24 )); 25 26 $getPreviewParam = new stdClass(); 27 $getPreviewParam->sessionId = $loginResponse->return->sessionId; 28 $cameraArray = $getCameraInfoByDeviceInfoResponse->return->cameraArray; 29 $cameraIndexCode = ''; 30 if (is_array($cameraArray)) { 31 $cameraIndexCode = $cameraArray[0]->indexCode; 32 } else { 33 $cameraIndexCode = $cameraArray->indexCode; 34 } 35 $getPreviewParam->cameraIndexCode = $cameraIndexCode; 36 37 $getPreviewParamResponse = $client->__call("getPreviewParam", array( 38 $getPreviewParam 39 )); 40 41 $this->ajaxReturn($getPreviewParamResponse->return->previewXml); 42 } コードを表示