[wsf-c-dev] [PHP] WSService API additions

Samisa Abeysinghe samisa at wso2.com
Thu Feb 15 01:23:01 PST 2007


It looks to me that we are into a problem with the wrapper.
The problem scenario is like this.
1. In the SOAP ext service code, user adds the function 'foo()' to be an 
operation of the service. This function, including the service 
implementation is in a script called bar.php
2. Our wrapper now needs to call this function, but our service object 
is created in the wrapper source SoapServer.php
3. Now when handle() is called, we create the WSService object in 
handle() wrapper in SoapServer.php and tries to call 'foo()' in bar.php.
    Our wrapper does not know anything about bar.php, and hence nothing 
anout 'foo()' function.
4. Hence the wrapper function that we were talking about to call this 
method form user code needs to use reflection. Our wrapper function in 
turn has to be called by service code of our C extension.

As of now, our operation implementations only take a WSMessage as a 
parameter. But we have to support an API where it takes a second mixed 
argument.

Samisa...

James Clark wrote:
>>> 2. When the user specifies a function foo with the Soap ext API, we
>>> implement this by wrapping foo in a function foo_wrapper before giving
>>> it to our API. foo_wrapper calls foo with the same arguments that
>>> foo_wrapper gets, but it uses the compatibility function (from 1) to
>>> convert the return value.  I don't know how we would handle creating
>>> foo_wrapper dynamically. Does php have closures?
>>>   
>>>       
>> PHP does not support closures.
>>     
>
> It looks like create_function() is the way to create the wrapper.
>
> James
>
>
>
>   


-- 
Samisa Abeysinghe : http://www.wso2.org/ (WSO2 Oxygen Tank - Web Services Developers' Portal)





More information about the Wsf-c-dev mailing list