Thread: [PHP-SOAP-DEV] setClass newbie question
Status: Alpha
Brought to you by:
rodif_bl
From: Jean-Charles P. <jc....@wa...> - 2002-05-10 08:47:38
|
hello I try to use the setClass method but i don't understand how it works. i have a php class called 'xslt', when i want to use it, i do : <?php require ('class.xslt.php'); $test =3D new xslt ('test.xml', 'test.xsl', TRUE); $test->transform(); echo $test->output(); ?> then with Soap extension i did :=20 /* server.php */ <?php require ("class.xslt.php"); $server =3D new SoapServer("urn:xslt"); $server->setClass('xslt');=20 $server->handle(); ?> /* client.php */ <?php=20 error_reporting(E_ALL); $test =3D new SoapObject("http://localhost:8080/xslt_server.php", = "urn:xslt");=20 $test->xslt('test.xml', 'test.xsl', TRUE); $test->transform(); echo $test->output(); if($test->__isFault()) var_dump($test->__getFault()) ?>=20 But it doesn't work and no error returned. My question is : Did i do a mistake?, How can i use this method ? Thanks you for your advices Jean-Charles Preaux http://analogx.dyndns.org icq://125624822 |
From: andrey <ahr...@ic...> - 2002-05-10 09:20:10
|
I've tried with no success the example from the site about sessions - server & client. The sessions are created in the server but and the session_id is equal among 3 requests but the server returns NULL. Why - I don't have an idea. I looked at the source at saw that there are some kind of session handling but only that - i'm not C guru. Obviously the session_id is caried between 3 requests but why NULL is received instead of 1,2,3. Unfortunately I need this feature and my temporal solution is CSession class I wrote last night which is a wrapper for sessions with 4 methods (constructor,get_var($name),set_var($name,$val), get_sid()). I've written 2 versions - at the moment I'm working with one that serialize in TEXT field (mysql). The second one uses session_*() of PHP but does not work as I said above. Looking forward for some advice. Andrey |
From: phpsurf <ph...@if...> - 2002-05-10 10:07:57
|
hi there is a little error in this example on the web site : in the session-server-src.php, you need to replace SoapObject with SoapServer ... certainly some too fast Copy/Paste ! :) and then it should work ... > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf > Of andrey > Sent: vendredi 10 mai 2002 11:19 > To: php...@li... > Subject: [PHP-SOAP-DEV] Problem with session example . Not working. > > > I've tried with no success the example from the site about sessions - > server & client. The sessions are created in the server but and the > session_id is equal among 3 requests but the server returns NULL. Why - I > don't have an idea. I looked at the source at saw that there are some kind > of session handling but only that - i'm not C guru. Obviously the > session_id > is caried between 3 requests but why NULL is received instead of 1,2,3. > Unfortunately I need this feature and my temporal solution is > CSession class > I wrote last night which is a wrapper for sessions with 4 methods > (constructor,get_var($name),set_var($name,$val), get_sid()). I've > written 2 > versions - at the moment I'm working with one that serialize in TEXT field > (mysql). The second one uses session_*() of PHP but does not work > as I said > above. > > Looking forward for some advice. > > 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 ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif |
From: andrey <ahr...@ic...> - 2002-05-10 10:10:12
|
Ok. I'll give it a try as well as the example from your previous post(on other subject). Andrey ----- Original Message ----- From: "phpsurf" <ph...@if...> To: "andrey" <ahr...@ic...>; <php...@li...> Sent: Friday, May 10, 2002 1:18 PM Subject: RE: [PHP-SOAP-DEV] Problem with session example . Not working. > hi > > there is a little error in this example on the web site : > in the session-server-src.php, you need to replace SoapObject with > SoapServer ... certainly some too fast Copy/Paste ! :) > and then it should work ... > > > -----Original Message----- > > From: php...@li... > > [mailto:php...@li...]On Behalf > > Of andrey > > Sent: vendredi 10 mai 2002 11:19 > > To: php...@li... > > Subject: [PHP-SOAP-DEV] Problem with session example . Not working. > > > > > > I've tried with no success the example from the site about sessions - > > server & client. The sessions are created in the server but and the > > session_id is equal among 3 requests but the server returns NULL. Why - I > > don't have an idea. I looked at the source at saw that there are some kind > > of session handling but only that - i'm not C guru. Obviously the > > session_id > > is caried between 3 requests but why NULL is received instead of 1,2,3. > > Unfortunately I need this feature and my temporal solution is > > CSession class > > I wrote last night which is a wrapper for sessions with 4 methods > > (constructor,get_var($name),set_var($name,$val), get_sid()). I've > > written 2 > > versions - at the moment I'm working with one that serialize in TEXT field > > (mysql). The second one uses session_*() of PHP but does not work > > as I said > > above. > > > > Looking forward for some advice. > > > > 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 > > > ____________________________________________________________________________ __ > ifrance.com, l'email gratuit le plus complet de l'Internet ! > vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... > http://www.ifrance.com/_reloc/email.emailif > > > |
From: phpsurf <ph...@if...> - 2002-05-10 09:23:58
|
hi due to the SOAP mechanism, every time you call a new method on your SoapObject (client side), it performs a new HTTP request to the soap server. so if you wanna be able to call several methods on the same object (construct, then trnasform, then get the result back) then you need to make your object persistent on the server side. to do that, you can find an example here : http://phpsoaptoolkit.sourceforge.net/phpsoap/guide/samples/session_object/ then your server script should be something like that : /* server.php */ <?php require ("class.xslt.php"); $server = new SoapServer("urn:xslt"); $server->setClass('xslt'); $server->setPersistence(SOAP_PERSISTENCE_SESSION); $server->handle(); ?> hope this will help ... -----Original Message----- From: php...@li... [mailto:php...@li...]On Behalf Of Jean-Charles Preaux Sent: vendredi 10 mai 2002 10:39 To: php...@li... Subject: [PHP-SOAP-DEV] setClass newbie question hello I try to use the setClass method but i don't understand how it works. i have a php class called 'xslt', when i want to use it, i do : <?php require ('class.xslt.php'); $test = new xslt ('test.xml', 'test.xsl', TRUE); $test->transform(); echo $test->output(); ?> then with Soap extension i did : /* server.php */ <?php require ("class.xslt.php"); $server = new SoapServer("urn:xslt"); $server->setClass('xslt'); $server->handle(); ?> /* client.php */ <?php error_reporting(E_ALL); $test = new SoapObject("http://localhost:8080/xslt_server.php", "urn:xslt"); $test->xslt('test.xml', 'test.xsl', TRUE); $test->transform(); echo $test->output(); if($test->__isFault()) var_dump($test->__getFault()) ?> But it doesn't work and no error returned. My question is : Did i do a mistake?, How can i use this method ? Thanks you for your advices Jean-Charles Preaux http://analogx.dyndns.org icq://125624822 ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif |