WSF/PHP Demo Site services can be accessed via https (Secured HTTP) transport. For an example you can access the echo service via https from https://2ec2.wso2.org/samples/echo_service.php endpoint. This can be used to identify whether you WSF/PHP instance is built with SSL enabled. (Note that from WSF/PHP 2.0.0 onwards, You have SSL enabled by default both in Linux and Windows, so for newer releases you don’t need explicitly set that when compiling).
Here is a sample client I used to connect to the https service. The only thing new from the traditional echo client is it has specified “CACert” option and the URL is pointing to a https service.
When you are developing a Web Service, you have to think about the security aspects of your service seriously. When it comes to security in web services you have two basic choices.
If you want message level security for your application, just use WS-Security. With WSF/PHP it is even easier to implement than SOAP over HTTPS method, because you can provide the certificates programatically in PHP and no need to do further configuration.
WSF/PHP provides you two classes in line with WSService to implement an API to provide WS-Security.
WSPolicy -Let you provide rules that the engine need to follow in securing the message. E.g.
In fact you can load policies from an xml which adheres to the WS-SecurityPolicy specification.
WSSecurityToken - Keeps the security tokens like certificates, keys, username, passwords which would be used when applying the rules specified in the policy. E.g.
$sec_token = new WSSecurityToken(array("privateKey" => $pvt_key,
"receiverCertificate" => $pub_key));