Saturday, January 19, 2008

WS-Addressing with WSF/PHP

Web Services addressing is one of the fundamental specifications which drives Web Services platform. There are lot of reasons why you need Web Services Addressing. For a detailed description see this.

WSO2 WSF/PHP fully support WS-Addressing. It inherits this from Axis2/C Web Service engine. Adding Addressing support in WSF/PHP is really simple.

You only need to add following lines to your PHP script when you are invoking a Web Service.

Assuming some one want to set Addressing action and endpoint uri using addressing. Then first add the following.

$reqMessage = new WSMessage($requestPayloadString,
array( "to" => "http://localhost/samples/echo_service_addr.php",
"action" => "http://php.axis2.org/samples/echoString"));

Then enable WS-Addressing.

$client = new WSClient(array("useWSA" => TRUE));

Similarly you can set FaulTto, ReplyTo and other addressing parameters as well.

No comments: