Class Inheritance support?
Hi
Does the extension support class inheritance?
i.e. if i have a class and a response object that extends from a common base ...
class myService
{
public function myMethod()
{
$response = new MyResponse;
$response -> is_success = true;
$response -> blah = 'blah';
return $response;
}
}
abstract class Response
{
public $is_success;
}
class MyResponse extends Response
{
public $blah;
}
assuming that I have added type comments to the file - will the WSDL and webservice client respect the inheritance?
cheers
dan
- Login or register to post comments
- Printer friendly version
- 106 reads











1. If you want to generate
1. If you want to generate WSDL from the above code in fact the generated WSDL doesn't reflect the inheritance. (normally in schema we use complex content extension for such kind of inheritance).
2. If you already have the WSDL, WSF/PHP realizes that the child object inherits it's parent attributes, but it doesn't realize any polymorphic behavior, such as you can't send the child's instance in place of parents type.
Thanks
Dimuthu
So is there /any/ way to
So is there /any/ way to realize polymorphic behavior?
This is quite important for the webservice I am designing, which features record management and will have ambiguous methods such as 'save', for example:
cheers
one thing you can do is use
one thing you can do is use the 'choice' content model for the save_request, for an example.
so in the message you can send either param1, param2 or param3 inside the saveRequest. But still you can not generate this from the code. (that is you can not use code first approach). Rather you have to write your wsdl on your own(contract first approach), and then provide the wsdl to WSClient or WSService to work.
Thanks
Dimuthu