loadXML($cli->__getLastRequest()); $dom->formatOutput = true; $dom = $dom->saveXML(); $dom = preg_replace_callback('`(<\??[^\s>]*)([^>]*)(\??>)`', 'tag', $dom); return $dom; } function tag($m) { $m = $m[0]; if(preg_match('`<\[CDATA\[([^]]|\][^]]|\]\][^>])*\]\]>`i', $m)) return ''.htmlentities($m).''; $start = preg_replace('`^(<\??[^\s>=]*).*`', '\1', $m); $end = preg_replace('`[^?>]`', '', substr($m, -2)); $mid = trim(substr($m, strlen($start), -1 * strlen($end))); if(preg_match_all('`([^=]+)=([^\s]*|"[^"]*")\s*`', $mid, $m)) { $mid = ''; for($i=0; $i='.htmlentities($m[2][$i]).''; } return ''.htmlentities($start).$mid.htmlentities($end).''; } ini_set('soap.wsdl_cache_enabled', '0'); //header('Content-Type: text/plain; charset=UTF-8'); try { $cli = new SoapClient('url_to_farm.wsdl_file', array('trace' => 1, 'soap_version' => SOAP_1_1)); if(isset($_GET['a'])) { print_r($cli->authenticateRemoteAppAndRun('remoteapp', 'pwd', 'animalExists', array('name' => $_GET['a']))); }elseif(isset($_GET['d'])) { print_r($cli->authenticateRemoteAppAndRun('remoteapp', 'pwd', 'animalDelete', array('name' => $_GET['d']))); }elseif(isset($_GET['new'])) { print_r($cli->authenticateRemoteAppAndRun('remoteapp', 'pwd', 'animalCreate', array('name' => $_GET['new']))); } if(isset($_GET['a']) || isset($_GET['d']) || isset($_GET['new'])) echo '
'.getLastRequestFormated($cli).'
'; foreach($cli->authenticateRemoteAppAndRun('remoteapp', 'pwd', 'animalsList') as $w) echo ''.$w['name'].' check del
'; //print_r($cli->authenticateRemoteAppAndRun('remoteapp', 'pwd', 'animalsList')); echo 'NEW
'; echo '
'.getLastRequestFormated($cli).'
'; }catch(SoapFault $f) { die('SOAP::Client fault : '.$f->getMessage()); } ?>