summaryrefslogtreecommitdiff
path: root/demos/soap/protected/pages/Home.php
blob: a52ea384af6792d37c64d5c3f203cc39428b3e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

class Home extends TPage
{
	private $_client=null;

	protected function getSoapClient()
	{
		if($this->_client===null)
		{
			$wsdlUri=$this->Request->AbsoluteApplicationUrl.'?soap=calculator.wsdl';
			$this->_client=new SoapClient($wsdlUri);
		}
		return $this->_client;
	}

	public function computeButtonClicked($sender,$param)
	{
		$number1=TPropertyValue::ensureInteger($this->Number1->Text);
		$number2=TPropertyValue::ensureInteger($this->Number2->Text);
		$this->AdditionResult->Text=$this->getSoapClient()->add($number1+$number2);
	}

	public function highlightButtonClicked($sender, $param)
	{
		$this->HighlightResult->Text=$this->getSoapClient()->highlight(file_get_contents(__FILE__));
	}

}

?>