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
Showing posts with label Class Map. Show all posts
Showing posts with label Class Map. Show all posts
WSDL Generation with and without $classmap option
Sunday, June 8, 2008
Labels:
1.3.*,
Class Map,
Demo,
Example,
WSDL Generation
Use WSDL Elements Maps to Your PHP Classes.
Tuesday, February 12, 2008
WSF/PHP allows you to map schema elements and types in your WSDL to PHP Classes in your code.. You can find a good example of this in the samples/wsdl_generation directory in the WSF/PHP pack.
You have to provide the map of wsdl type to the PHP class name as an option to both WSClient(in a case it is a client) and WSService(in a service).
From WSF/PHP 1.2.1 patch release you will not need to provide the full map of classes to schema construct. Since the engine will be intelligent enough to pick the class with the same name as schema construct when the class is not provided in the class map. If there is no class like that at all, the engine will create a unnamed class and allow to access its properties as it was a class like made to represent that schema construct.
So hope you will enjoy the new improvements to the API.
You have to provide the map of wsdl type to the PHP class name as an option to both WSClient(in a case it is a client) and WSService(in a service).
From WSF/PHP 1.2.1 patch release you will not need to provide the full map of classes to schema construct. Since the engine will be intelligent enough to pick the class with the same name as schema construct when the class is not provided in the class map. If there is no class like that at all, the engine will create a unnamed class and allow to access its properties as it was a class like made to represent that schema construct.
So hope you will enjoy the new improvements to the API.
Deploy your PHP class as a Webservice
Thursday, January 10, 2008
With the new WSO2 WSF/PHP 1.2 you can publish PHP classes as a web service.
You are able to publish multiple PHP classes as a web service. Then your PHP code for the WSService would be something like this..
Visit here for a good sample of an application of this feature..
You are able to publish multiple PHP classes as a web service. Then your PHP code for the WSService would be something like this..
/* set operations and constructor arguments for the class1 */
$class1_operations = array("service_operation" => "php_class_function_in_class1",
/* and so on..*/);
$class1_constructor_arguments = array("arg1", "arg2", /* and so on..*/);
/* set operations and constructor arguments for the class2 */
$class2_operations = array("service_operation" => "php_class_function_in_class2",
/* and so on..*/);
$class2_constructor_arguments = array("arg1", "arg2", /* and so on..*/);
/* set these in to the classes option of the WSService in following way */
new WSService(array("classes" => array(
"class1_name" => array("operations" => $class1_operations, "args"=> $class1_constructor_arguments),
"class2_name" => array("operations" => $class2_operations, "args"=> $class2_constructor_arguments) ) ) );
Visit here for a good sample of an application of this feature..
Labels:
Class Map,
WSO WSF/PHP
Subscribe to:
Posts (Atom)