ZiBaT => Peter Levinsky => Programming => exercise

PHP Twig
Simple MVC PHP + consuming Soap

Updated : 2016-09-26

Exercise: PHP,Twig & Soap, simple calculator

Mission:

To create a PHP application in PHPStorm using a MVC framework (here Twig).

You are to consume a soap service..

Precondition:

  1. Php with twig PHP-calculator-twig.html
  2. Simple web service (calculator as soap) MyOwnWebServices.htm

exercise 1: Make Soap run

Find your 'old' soap service to calculate (see MyOwnWebServices.htm ).

Publish this soap service in Azure (try to reuse your web-service)

Now run / get the wsdl-file location (' your web-site '\service.svc) e.g. 'http://web-pele-easj.azurewebsites.net/service1.svc'

 

Exercise 2: Refactor your PHP calculator

Refactor your PHP application ( PHP-calculator-twig.html) from simple calculation to using the soap service.

You are to refactor the PHP-page (e.g. 'calculator.php') to use the soap service to make the calculation instead of doing it in the php-page.

(In real live you will not send a soap request for such a small task :-( :: But for the consuming soap skills it is ok :-) )

Notice you do not need to change your view !

 

Extra A: Publish Your PHP application in azure

You can create another web-site in the azure e.g. i have web-pele-easj for 'normal' web (soap/rest in c#) and php-pele-easj for PHP.

Deploy your PHP calculator to Azure. Follow the help instruction