Shamil Salakhetdinov
shamil-users at mns.ru
Fri Jan 9 14:52:18 CST 2004
Marty, Thanks for your refs! I seems to have success with NuSoap as I wrote in my second messge to this thread. Now, the question is can I put more than one function in PHP WebService script - e.g. having this: <?php require_once('../nu/nusoap.php'); $s = new soap_server; $s->register('hello'); function hello($name){ // optionally catch an error and return a fault if($name == ''){ return new soap_fault('Client','','Must supply a valid name.'); } return "HELLO, $name!"; } $s->service($HTTP_RAW_POST_DATA); ?> How can I add something like this: function hello1($firstname, $lastname){ return "HELLO, $name $lastname!"; } to make it a second web service located in the same php file? Of course I can make another .php file but I hope it's possible to use one with two or more functions/web services. TIA, Shamil ----- Original Message ----- From: "MartyConnelly" <martyconnelly at shaw.ca> To: "Discussion of Hardware and Software issues" <dba-tech at databaseadvisors.com> Sent: Friday, January 09, 2004 11:20 PM Subject: Re: [dba-Tech] Creating WebServices using PHP (preferred) or PERL > Well I know there was a large problem with Axis Soap and/or Apache and > MS Soap clients > It was fixed in later versions of Axis, RPC Document Lit coding? > > See listed in here somewhere > http://www.searchwebservices.com > http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_gci913069,00.html > or you could try the NuSoap code and PHP IDE > from > http://www.NuSphere.com > https://lists.sourceforge.net/lists/listinfo/nusoap-general > > or > http://sourceforge.net/projects/phpsoaptoolkit/ > > http://news.php.net/group.php?group=php.soap&i=1280 > Axis with Java RPC > http://www.techmetrix.com/trendmarkers/wp/pubproduct.php?P=wpp0802-1 > > You may have to use something like GLUE to generate your WSDL file > > Shamil Salakhetdinov wrote: > > >Hi All, > > > >Anybody knows it's a children work to make and install a Web Service > >using MS Tools - e.g. using MS VB6 and MS SOAP Toolkit 3.0. It's the > >same kind of easy work to get referenced and use a Web Service from > >VS.Net... > > > >Unfortunately I need/wanted to make a Web Services using PHP or PERL to > >run it on my ISP site, which uses Linix and Apache. > > > >I did some intensive search and I've found two interesting tools: > > > >- PHP: ftp://ftp.activestate.com/WebService/PHP/webservice.zip > >(http://dietrich.ganx4.com/nusoap/index.php) > >- PERL: http://soaplite.com/ > > > >PERL doesn't work on my ISP - some strange errors when using SOAP::Lite > >package (Can't locate URI.pm in @INC ) and I didn't yet find how to > >solve this problem - they say the path to one on the packages should be > >explicitly specified - added to the @INC array - how to add the path to > >this array - still a problem for me because I don't know PERL... > > > >I went more smoothly with PHP (I did get working sample web service > >callable from PHP itself) but I don't see how I can implement a PHP Web > >Service callable from e.g. VS.Net. Did anybody here do that? > > > >Basically, what is needed as far as I understand is to make a WSDL file > >similar to the one generated by SOAP Toolkit with the only difference > >that <port> element of this WSDL file should refer to a .php script - > >something like that: > > > >... > > <service name='wshello' > > > <port name='CHelloSoapPort' binding='wsdlns:CHelloSoapBinding' > > > <soap:address location='http://localhost/wstest/wshello.PHP'/> > > </port> > > </service> > >... > > > >Now, wshello.php should be able to accept SOAP requests from wshello web > >service clients, parse them to get parameters, call a .PHP, .cgi, etc > >.... implementations of a web service, get result and return SOAP > >response to the client. > > > >PHP solution (webservice.zip) referred above has sample code (see > >P.S.) - the samples 1 and 2 work OK for me but I must say I don't know > >what they mean by samples 3 and 4 nor I don't know how to call this > >sample PHP web service (sample 1 - works OK when called from sample 2) > >from VS.NET. > > > >I guess the solution is very close if exists at all but I'm stuck with > >what to do next :( > > > >What I'm missing? > >Can anybody help me? > > > >TIA, > >Shamil > > > >P.S. > > > >USAGE EXAMPLES: (webservice.zip) > > > >1. BASIC SERVER EXAMPLE > > > ><?php > > > >require_once('nusoap.php'); > >$s = new soap_server; > >$s->register('hello'); > >function hello($name){ > > // optionally catch an error and return a fault > > if($name == ''){ > > return new soap_fault('Client','','Must supply a valid name.'); > > } > > return "hello $name!"; > >} > >$s->service($HTTP_RAW_POST_DATA); > > > >?> > > > >2. BASIC CLIENT USAGE EXAMPLE > > > ><?php > > > >require_once('nusoap.php'); > >$parameters = array('name'=>'dietrich'); > >$soapclient = new soapclient('http://someSOAPServer.com/hello.php'); > >echo $soapclient->call('hello',$parameters); > > > >?> > > > >3. WSDL CLIENT USAGE EXAMPLE > > > ><?php > > > >require_once('nusoap.php'); > >$parameters = array('dietrich'); > >$soapclient = new > >soapclient('http://someSOAPServer.com/hello.wsdl','wsdl'); > >echo $soapclient->call('hello',$parameters); > > > >?> > > > >4. PROXY CLIENT USAGE EXAMPLE (only works w/ wsdl) > > > ><?php > > > >require_once('nusoap.php'); > >$soapclient = new > >soapclient('http://someSOAPServer.com/hello.wsdl','wsdl'); > >$soap_proxy = $soapclient->getProxy(); > >echo $soap_proxy->hello('dietrich'); > > > >?> > > > >-- > >e-mail: shamil at smsconsulting.spb.ru > >Web: http://smsconsulting.spb.ru/shamil_s > > > >_______________________________________________ > >dba-Tech mailing list > >dba-Tech at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-tech > >Website: http://www.databaseadvisors.com > > > > > > > > -- > Marty Connelly > Victoria, B.C. > Canada > > > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com