Re: Class based method overloading
| From: | Bertho Stultiens | Date: | Wed, 18 Jul 2007 16:28:24 +0000 |
| Subject: | Re: Class based method overloading | ||
| References: | 1 2 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2576@lists.php.net to get a copy of this message | ||
Ammarmar wrote:
> This is a rather unusual WSDL (especially the binding section with named
> inputs etc). I assume you have no way to rewrite it.
Firstly, the getSupSet1 in the second operation of the WSDL is a typo.
It should read getSupSet for overloading to work... The I/O
specification is correct though.
And secondly, you are completely right; I have no way of changing the
WSDL. I am re-implementing a larger set of legacy interfaces (10 in all)
and am mapping them onto a single backend. This is a what you would call
a cross-my-fingers-and-hope-it-still-works-for-all project where it is
simply impossible to reimplement all bugs. Still, the benefit in
performance and maintainability is so high that it is worth it.
> PHP5 does not support overloading functions.
That is what I also thought.
> Have you tried to create multiple functions named after portType
> operations? (getSupSet, getSupSet1 etc)
The solution I have now, is to create a hacked WSDL which renames the
functions from xx, xx, xx to xx1, xx2, xx3, etc. Then I "patch" the
HTTP_RAW_POST_DATA before I create my server class based on the detected
arguments to the call. I still return the original WSDL on request, but
internally use the patched one. This is quite a dirty hack, but it
works. I was just hoping for a more clean solution.
For PHP to support overloading, I suppose there must be a "methodmap"
(similar to the classmap) which is used to remap the WSDL
operation/input/output pair to a class-function.
--
Greetings Bertho
(disclaimers are disclaimed)