Thread: [PHP-SOAP-DEV] Re: php-soap mailing lists
Status: Alpha
Brought to you by:
rodif_bl
|
From: brad l. <rod...@ya...> - 2002-05-02 17:58:46
|
--- andrey <ahr...@ic...> wrote:
> HI,
> OK. I'm in. I have also an account on sourceforge - androto but I've no
> experience with the system. If that fact can help - ok.
> I read your update about the exposed functions and I am very satisfied. I
> saw that thing and wanted to ask why it is done in that way.
> Something is coming into my mind...Now if I have to add 10 of 15 available
> functions I've to write 10 times some kind of register. One idea is to pass
> an one dimensional array with names of functions
this is alreday done ... this is docuemted too :)
$soap->addFunction(array('function_one', 'function_two'));
(probably we can have 2
> dimensions where the functions is method of a class) and to register those.
this is handled differently.. if you want to expose all methods for a class you
have to.
$soap->setClass("some_class");
class some_class
{
function method_one();
function method_two();
}
now the soap server will act just like that class will.
and you can acually have persitiant objects too... take a look at
http://phpsoaptoolkit.sourceforge.net/phpsoap/guide/samples/object/
and
http://phpsoaptoolkit.sourceforge.net/phpsoap/guide/samples/session_object/
> So I can declare all exported functions in one array at the beggining of the
> file or in some config.php "include". The second idea is to have config XMLs
> and to load then as in GLADE library that constructs a GUI at runtime but I
> think this will be slow.
> You said something about checking first five bytes whether they are <?xml .
> I saw another way to check for xml document in the userspace of XMLRPC.
> There instead of checking first five bytes, a search for <?xml is done and
> the input is read the the position where the string is found but this can be
> a performance problem probably.
> One remark fot the site :
> Here http://phpsoaptoolkit.sourceforge.net/phpsoap/guide/documentation/ the
> title is misspelled - "Docuemntation" instead of "Documentation"
> Now I'll download the new packages and will give them a try this
> evening/night.
> Last question. You said the the module cannot be compiled as DSO. What I've
> to do to test it under linux - to build php into apache?
yeah it can't be compiled as a dso.. it can be compiled in staically..
just your normal configure.
./configure --enable-soap --(other php config options) --with-apache=(apache
location)
>
> Best regards,
> Andrey
>
> ----- Original Message -----
> From: "brad lafountain" <rod...@ya...>
> To: <ahr...@ic...>
> Sent: Thursday, May 02, 2002 7:48 AM
> Subject: php-soap mailing lists
>
>
> > Hello, I noticed that you weren't on the mailing lists.
> >
> > I would like you to join so you can get my update notices.
> >
> >
> > - Brad
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - your guide to health and wellness
> > http://health.yahoo.com
> >
>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
|
|
From: andrey <ahr...@ic...> - 2002-05-02 18:14:40
|
Hi Brad,
> $soap->setClass("some_class");
>
> class some_class
> {
> function method_one();
> function method_two();
> }
>
> now the soap server will act just like that class will.
But what if the class has some methods I don't want to expose one or more
methods? However I think that adding method of a class is done transparently
so
$server->addfunction(array("some_class","method_one"));
This kind of adding works in the gtk extension as well as in the xmlrpc
extension.
> yeah it can't be compiled as a dso.. it can be compiled in staically..
> just your normal configure.
>
> ./configure --enable-soap --(other php config
options) --with-apache=(apache
> location)
Ok. I'll try to build it tonight.
Andrey
|
|
From: brad l. <rod...@ya...> - 2002-05-02 18:43:30
|
--- andrey <ahr...@ic...> wrote:
> Hi Brad,
>
> > $soap->setClass("some_class");
> >
> > class some_class
> > {
> > function method_one();
> > function method_two();
> > }
> >
> > now the soap server will act just like that class will.
> But what if the class has some methods I don't want to expose one or more
> methods? However I think that adding method of a class is done transparently
> so
> $server->addfunction(array("some_class","method_one"));
> This kind of adding works in the gtk extension as well as in the xmlrpc
> extension.
Well when you do
$soap->setClass("class");
I look at it like that soap service IS that class. Why i did that is... You can
build a class and expose it thur soap.. and have any client use your soap
object as is.. no changing your object.. just like they would use it locally. I
really want to keep this functionality. Its very very useful. Cause you can
create an instance of the object and persist it. I can make the extension not
expose private functions like _*() functions.
take a look at that sample..
http://phpsoaptoolkit.sourceforge.net/phpsoap/guide/samples/session_object/
Now if you are talking about a non-class based soap-server and you just want to
expose some methods to an existing class the class method will have to be
static. Meaning the method can't access any $this-> members or functions. The
extension doesn't currently handle this.
here is an example.
<?
$server->addFunction(array("foo" => "bar", "foo" => "foo"));
// when someone trys to call foo->foo (thru soap) it will fail.. cause
// there isn't an instance of foo.
class foo
{
var $foo = 'foo';
function bar($bar)
{
return "bar says $bar";
}
function foo()
{
return "foo can't say $this->foo";
}
}
?>
> > yeah it can't be compiled as a dso.. it can be compiled in staically..
> > just your normal configure.
> >
> > ./configure --enable-soap --(other php config
> options) --with-apache=(apache
> > location)
> Ok. I'll try to build it tonight.
tell me how it goes
>
> Andrey
>
>
> _______________________________________________________________
>
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: ban...@so...
> _______________________________________________
> Phpsoaptoolkit-development mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phpsoaptoolkit-development
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
|
|
From: andrey <ahr...@ic...> - 2002-05-02 18:53:55
|
> I look at it like that soap service IS that class. Why i did that is... You can > build a class and expose it thur soap.. and have any client use your soap > object as is.. no changing your object.. just like they would use it locally. I > really want to keep this functionality. Its very very useful. Cause you can > create an instance of the object and persist it. I can make the extension not > expose private functions like _*() functions. That is a good point. Two choices : 1) to ban _*() functions or 2) to allow export_*() functions but they will be seen as *() (export_sum() will be sum() outside) "export" can be any other meaningful word. Regards, Andrey |