Discussion:
Possible to offer a service from a simple function?
Yannick
2008-07-28 00:52:23 UTC
Permalink
Hi there,

As I am trying out SCA, a bunch of questions come to mind. I'll try to
stick to one-question-per-mail for clarity and indexing of the
answers.

Following the documentation here http://www.osoa.org/display/PHP/SCA+Documentation#SCADocumentation-2:
"...PHP annotations are used to define PHP classes as SCA
components,...".
As far as I can see, there's no way to use a simple functions library
and provide web services from it, is there?

If not, considering a functions library should also use a file-level
header for PHPDocumentor, is there a particular reason why it is not
possible to use simple functions?

Thanks,

Yannick
Yannick
2008-07-30 03:22:34 UTC
Permalink
I'd really like to get started soon on web services implementation,
and the series of e-mails I have sent give a clear idea of my concerns
regarding SCA. I won't lie, I'm currently looking at other projects
because of the shortcomings I have found in SCA, which kind of sucks
as I really liked the idea behind SCA (re-use of existing functions
using PHPDoc comments). On the other hand, I really can't see how one
could provide web services using existing functions if:

- they absolutely have to use classes
- the files must have the same name as the class inside (What if there
are two classes inside? What if you have an existing open-source
project with lots of files depending on your class?). Apparently there
is no way either to include a class-definition file intp a placeholder
file which holds the right filename (because of the time at which the
inclusion statement is processed the comments are already gone).
- there is no security check anywhere
- a missing space or a minor difference in the PHPDoc format can break
the parsing process

Anyway, if it doesn't work out now, it might work out later. I'll try
to assist in fixing all these little issues that make it very
difficult to use for me (and in the meantime, I'll probably fall down
to a PHP solution like NuSOAP or something of the likes).

Thanks anyway,

Yannick
Post by Yannick
Hi there,
As I am trying out SCA, a bunch of questions come to mind. I'll try to
stick to one-question-per-mail for clarity and indexing of the
answers.
"...PHP annotations are used to define PHP classes as SCA
components,...".
As far as I can see, there's no way to use a simple functions library
and provide web services from it, is there?
If not, considering a functions library should also use a file-level
header for PHPDocumentor, is there a particular reason why it is not
possible to use simple functions?
Thanks,
Yannick
Graham Charters
2008-07-31 13:46:16 UTC
Permalink
Hi Yannick,

Apologies for not replying sooner. I'm swamped with other activities
at the moment, so not able to contribute much :-(

I think in principle there's nothing preventing a function being
exposed as SCA component. This hasn't been done and I'm sure there
would be devils in the detail around building up service descriptions,
and so on. I believe ext/soap supports functions as service
implementations so it should be possible to target them with
@binding.ws.

If it's something you'd be interested to work on, I'd be glad to help
in what little time I can spare. In the absence of this support, I
think wrapper classes is the only option, which I agree is not ideal.

Sorry I can't be of more help.

Regards, Graham.
Or actually I might use SCA, but will newly built methods, which kinds
of defeats half the purpose.
Post by Yannick
I'd really like to get started soon on web services implementation,
and the series of e-mails I have sent give a clear idea of my concerns
regarding SCA. I won't lie, I'm currently looking at other projects
because of the shortcomings I have found in SCA, which kind of sucks
as I really liked the idea behind SCA (re-use of existing functions
using PHPDoc comments). On the other hand, I really can't see how one
- they absolutely have to use classes
- the files must have the same name as the class inside (What if there
are two classes inside? What if you have an existing open-source
project with lots of files depending on your class?). Apparently there
is no way either to include a class-definition file intp a placeholder
file which holds the right filename (because of the time at which the
inclusion statement is processed the comments are already gone).
- there is no security check anywhere
- a missing space or a minor difference in the PHPDoc format can break
the parsing process
Anyway, if it doesn't work out now, it might work out later. I'll try
to assist in fixing all these little issues that make it very
difficult to use for me (and in the meantime, I'll probably fall down
to a PHP solution like NuSOAP or something of the likes).
Thanks anyway,
Yannick
Post by Yannick
Hi there,
As I am trying out SCA, a bunch of questions come to mind. I'll try to
stick to one-question-per-mail for clarity and indexing of the
answers.
"...PHP annotations are used to define PHP classes as SCA
components,...".
As far as I can see, there's no way to use a simple functions library
and provide web services from it, is there?
If not, considering a functions library should also use a file-level
header for PHPDocumentor, is there a particular reason why it is not
possible to use simple functions?
Thanks,
Yannick
Yannick
2008-08-01 05:02:39 UTC
Permalink
Thanks, I'll see what I can do, I'm also a little short on time (I
tend to work on things in peaks and then move on to other things, so
that'll have to wait until the next peak for now)
Post by Graham Charters
Hi Yannick,
Apologies for not replying sooner.  I'm swamped with other activities
at the moment, so not able to contribute much :-(
I think in principle there's nothing preventing a function being
exposed as SCA component.  This hasn't been done and I'm sure there
would be devils in the detail around building up service descriptions,
and so on.  I believe ext/soap supports functions as service
implementations so it should be possible to target them with
@binding.ws.
If it's something you'd be interested to work on, I'd be glad to help
in what little time I can spare.  In the absence of this support, I
think wrapper classes is the only option, which I agree is not ideal.
Sorry I can't be of more help.
Regards, Graham.
Or actually I might use SCA, but will newly built methods, which kinds
of defeats half the purpose.
Post by Yannick
I'd really like to get started soon on web services implementation,
and the series of e-mails I have sent give a clear idea of my concerns
regarding SCA. I won't lie, I'm currently looking at other projects
because of the shortcomings I have found in SCA, which kind of sucks
as I really liked the idea behind SCA (re-use of existing functions
using PHPDoc comments). On the other hand, I really can't see how one
- they absolutely have to use classes
- the files must have the same name as the class inside (What if there
are two classes inside? What if you have an existing open-source
project with lots of files depending on your class?). Apparently there
is no way either to include a class-definition file intp a placeholder
file which holds the right filename (because of the time at which the
inclusion statement is processed the comments are already gone).
- there is no security check anywhere
- a missing space or a minor difference in the PHPDoc format can break
the parsing process
Anyway, if it doesn't work out now, it might work out later. I'll try
to assist in fixing all these little issues that make it very
difficult to use for me (and in the meantime, I'll probably fall down
to a PHP solution like NuSOAP or something of the likes).
Thanks anyway,
Yannick
Post by Yannick
Hi there,
As I am trying out SCA, a bunch of questions come to mind. I'll try to
stick to one-question-per-mail for clarity and indexing of the
answers.
"...PHP annotations are used to define PHP classes as SCA
components,...".
As far as I can see, there's no way to use a simple functions library
and provide web services from it, is there?
If not, considering a functions library should also use a file-level
header for PHPDocumentor, is there a particular reason why it is not
possible to use simple functions?
Thanks,
Yannick
Loading...