jest sobie serwer SOAP:
<?php require_once( "gilotyna.class.php" ); $server = new SoapServer( "gilotyna.wsdl" ); $server->setClass("gilotyna", "testowy kod" ); $server->handle(); ?>
klasa gilotyna:
<?php class gilotyna { private $strShopKey = NULL; private $strUserKey = NULL; private $arrMessage = NULL; ); public function __construct( $strShopKey = 'test' ) { $this->strShopKey = $strShopKey; } public function test( $str ) { return $str; } public function setShopKey( $strShopKey ) { $this->strShopKey = $strShopKey; } public function setUserKey( $strUserKey ) { $this->strUserKey = $strUserKey; } public function getMessage() { return $this->arrMessage; } public function checkUserKey() { try { if ( $this->strUserKey == NULL ) { throw new Exception ( '0' ); } return true; } catch ( Exception $e ) { $this->arrMessage = $this->arrError[$e->getMessage()]; return false; } } } ?>
i klient:
<?php $objClient = new SoapClient('http://localhost/gilotynaSoapServer/gilotyna.wsdl' ); $objClient->setShopKey( 'KEYTESTOWY' ); if ( $objClient->checkUserKey()) { } else { } ?>
Mój problem polega na tym, że jak się łączy i sprawdza
<?php if ( $objClient->checkUserKey()) ?>
wyswietla na ekranie "blad", natomiast:
<?php ?>
nie wyswietla nic, czyli nie działa to:
<?php $this->arrMessage = $this->arrError[$e->getMessage()]; ?>
wyglada to tak jakby pola pomiedzy metodami klasy sie nie przypisywaly.
Spotkał się z tym już ktoś, w czym może być problem??
nie wyswietla nic