WSDL Generation with and without $classmap option

Sunday, June 8, 2008

The $classmap is an option you can provide to the WSService constructor to tells the WSF/PHP engine that how you map the xml elements to PHP classes in your program.

When you provide classmap option, your service function declration should be such that it input the request object and output the response object.

When you don't provide classmap option, you will have a service function declration with set of input fields as input parameters. (Note that in both cases the response can be either an array or response, only the request parameter set is different from each other in two cases)

You can see how the WSDL is genererting for both above cases, which will also demonstrate the different between the service fuction declarations.

1. When the $classmap is provided, http://labs.wso2.org/wsf/php/php2wsdltool.php?example=Example3
The function declration is

/**
* echoValue function
* @param object Foo $echoString echoString description
* @return object FooResponse $echoStringResponse
*/
function echoValue($echoString){
}

2. When the $classmap is not provided, http://labs.wso2.org/wsf/php/php2wsdltool.php?example=Example4
The function declration is
/**
* echoValue function
* @param array of object Foo $param1 param1 description
* @param string $param2
* @return array of object Boo $ret_value
*/
function echoValue($param1, $param2){
}

You can find more details at here, http://wso2.org/project/wsf/php/1.3.2/docs/wsdl_generation_api.html

No comments: