|
From: Klaasjan T. <k.t...@mi...> - 2003-03-01 16:45:13
|
Hi,
After my holiday to Egypt, i bumped into a pile of work at work.. (as
usually). Now i've taken some time to look at the changes. They look fine to
me, although I have some questions.
Structure on filesystem
=================
I would like to use the flashservices as a "library". So I like to have it
once on my whole filesystem and then include and use it for my (multiple)
gateways. I imagine it like have an /home/httpd/include/ containing the
"flashservices" package.
The PHP include-path is set to ".:/home/httpd/include/" .
The code for a gateway would look like:
include "flashservices/app/Gateway.php";
$gateway = new Gateway();
$gateway->setSafeExecution(true);
$gateway->setInstanceName("SecuredWithName");
$gateway->setBaseClassPath("services/");
$gateway->service();
Although this include totally breaks everything. To make it work, i have to
put /home/httpd/include/flashservices/ into my include_path and say
include "app/Gateway.php";
I don't think this is beautifyfull.
So my proposal is to set the "rule" to "put the flashservices/ dir into your
includepath and work like sample 1"
This means we have to fix the "includes" in the package accordingly.
I still can have my own BaseClassPath with services under the currentDir (as
long as you have "." in your include_path)
Safemode execution
==============
Justin introduced the "instance" key for the methodTable. With this, the
instanceName set by the gateway has to be the same as the instancename
mentioned in the methodTable. One line up it says setSafeExecution(true) .
The current behaviour won't allow you to set it to false. The Executive
class checks for one of both (SafeExecution or instance given)
(Executive.php:175) if ($this->_safeExecution ||
isset($methodrecord['instance']))
To my oppinion, this should be changed to $this->_safeExection only.
Maybe I am wrong here and don't understand the security model here. It
probably depends on the contract between the gateway and the services given.
At the moment, I think, both are being programmed by the same developer. So
If he wants to turn of security, he only has to say
"setSafeExecution(false)" and all the checks (even the one for "instance")
are skipped.
WebServices proxy
==============
the CF and Java gateways allows flash to call the gateway using a given WSDL
file. I've sent a patch to this list based on the previous versoin. Ahmet
Zorlu has sent a proxy. The difference is that the first one worked like the
"Macromedia Style". The second one as another way of invocation.
The differences:
"Macromedian style"
-----------------------
NetServices.setDefaultGatewayURL("http://host/gateway.php");
var conn = NetServices.createGatewayConnection();
var myService = conn.getService("http://www.host.com/path/to/wsdl.wsdl",
this);
myService.sampleMethod(responder,arg1,arg2,arg3)
(see also:
http://www.evolt.org/article/Flash_Remoting_Demystified/17/48594/)
"Alternate style by Ahmet"
------------------------------
NetServices.setDefaultGatewayURL("http://host/gateway.php");
var myService = conn.getService("WebServiceProxy", this);
var wsdlLoc = "http://live.capescience.com/wsdl/AirportWeather.wsdl";
var operationName = "getSummary";
var params = new Object();
params.arg0 = sel.symbol ;
myService.getMessage(wsdlLoc, operationName, params);
The second way is a "plugin" to the framework, but not standard style. The
first way has to be put into the framework. The problem here is to identify
that it is a webservice WSDL file (starting with http:// and ending with
wsdl ???). What will our way of working here?
"allow_call_time_pass_reference"
=========================
Finally, there is some "soon to be obsolete functionlity in PHP" in the
code.
If you have in your php.ini
allow_call_time_pass_reference = On
And you probably have, otherwise amfphp is not working
Comments from the same ini file:
; Whether to enable the ability to force arguments to be passed by reference
; at function call time. This method is deprecated and is likely to be
; unsupported in future versions of PHP/Zend. The encouraged method of
; specifying which arguments should be passed by reference is in the
function
; declaration. You're encouraged to try and turn this option Off and make
; sure your scripts work properly with it in order to ensure they will work
; with future versions of the language (you will receive a warning each time
; you use this feature, and the argument will be passed by value instead of
by
; reference).
So we have to look at the code with the switch
allow_call_time_pass_reference = Off
Klaasjan
----- Original Message -----
From: "Justin Watkins" <ju...@24...>
To: <amf...@li...>
Sent: Friday, February 21, 2003 1:17 AM
Subject: [amfphp-cvs] updates
> As you can obviously see, I made quite a few changes. Hopefully this
> is more along the lines of every one's visions. Most of the developers
> should have recieved John's changes. His changes are the complete base
> for the updates I made. The log entry I put with the changes explains
> everything. I haven't updated the examples yet, and I will work on
> that later. I hope especially, Klaasjan, is ok with the changes.
>
> Our motivation for removing the including, initing and calling of the
> gateway from a registered service is: then that very precious code you
> wrote as the service can ONLY be used as a AMFPHP service. Nothing
> else, you can never include it in another php app. Now I know you
> could always build a facade of some sorts, but this way you don't have
> to do any of that, and can still have the seperation and control you
> had with the previous registered version with more abstraction from the
> gateway.
>
> I will work on getting the ServiceBrowser methods working, as that was
> the motivation for the subclassing of the service.
>
> There are about 1/2 dozen things I want to change still but I thought I
> would get this one out to everyone as soon as possible because it is a
> pretty big one.
>
> Justin
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
> The most comprehensive and flexible code editor you can use.
> Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
> www.slickedit.com/sourceforge
> _______________________________________________
> amfphp-cvs mailing list
> amf...@li...
> https://lists.sourceforge.net/lists/listinfo/amfphp-cvs
>
|