Implementing SOAP Server on CakePHP

23 01 2008

My key concept is: create the SOAP server in the Controller and the methods in the Model. Why? Because controller is … (read this) and model is this.

As an example here we gonna make web service for Post of a Blog (see Blog Tutorial) using native SOAP in PHP version 5.

We’ll put the SOAP handler at URL: http://yourhost/posts/service and the WSDL (which is will be used by the SOAP consumer) at URL: http://yourhost/posts/wsdl.

  1. Create table Post (see the Blog Tutorial for details).
  2. Create Post model (models/post.php) as usual.
  3. Create Post controller (controllers/posts_controller.php), see bellow. You need RequestHandler component for create XML-type response on wsdl action.
  4. Create view for action “wsdl” (views/posts/wsdl.ctp) and define your service method in it. You can publish all of methods in Post model including from its parent (AppModel), eg. findById(), find(), findAll(), etc. Note: you should turning off “short_open_tag” in php.ini to avoid error on rendering the xml of wsdl view. And don’t forget to define your service address in the WSDL to http://yourhost/posts/service.
  5. Now your service consumer could consume your service by pointing to your WSDL URL (http://yourhost/posts/wsdl).

Here are the sample codes: Read the rest of this entry »





Disable AutoRun in Ms. Windows

23 01 2008

Via group policy:

  1. Go to Start > Run
  2. Type gpedit.msc & press Enter. You should see the Group Policy window.
  3. In the left-hand column, select Computer Configuration > Administrative Templates > System
  4. Next, look in the right-hand column for “Turn off Autoplay”, and double-click on that.
  5. Next, in the “Turn Off Autoplay Properties” window, select “Enabled”
  6. Then choose “All drives” from the dropdown menu in “Turn off Autoplay on:”
  7. Click OK.







Follow

Get every new post delivered to your Inbox.