[wsf-c-dev] [PHP] WSService API additions
Samisa Abeysinghe
samisa at wso2.com
Thu Feb 15 04:22:29 PST 2007
Samisa Abeysinghe wrote:
>
>>
>> I don't completely understand your explanation. Are you saying
>> reflection solves the problem?
> Well I thought it would, but reflection does not solve the problem.
> Basically the function that we are trying to call is on another script
> written by user. :(
> When I try to invoke the wrapper, WSService constructor gives an error:
> '<br /><b>Fatal error</b>: WSService::__construct() [<a
> href='function.--construct'>function.--construct</a>]: Named function
> not in function table in
> <b>/usr/local/apache2/htdocs/wssoap/soap_ext/SoapServer.php</b> on
> line <b>187</b><br />'
Digging further into the problem, it looks to me that the WSService
constructor fails to locate the function created using create_function
method.
For a single function, what I have done is this in addFunction
(and yes, I have hard coded some stuff, just to get the thing working)
if (is_string($functions)) {
$newfunc = create_function("\$m, \$fn = $functions",
'return new
WSMessage("<result><text>".call_user_func($fn,
\'sam\')."</result></text>");');
$this->_operations[$functions] = "$newfunc";
}
Then in the handle function, I do the following:
$this->_service = new WSService(array('operations' =>
$this->_operations));
$this->_service->reply();
Samisa...
More information about the Wsf-c-dev
mailing list