RE: [PHP-SOAP-DEV] WSDLGenerator
Status: Alpha
Brought to you by:
rodif_bl
From: brad l. <rod...@ya...> - 2002-04-30 22:41:09
|
--- phpsurf <ph...@if...> wrote: > > > -----Original Message----- > > When php-soap starts generating wsdl's it is going to be soley > > dependant on the > > user documenting their code. phpdoc style. Otherwise the wsdl > > generator can't > > know types and parameters. Well I think we are talking about two differnt things here. 1) wsdl generation.. The wsdl has definintions about parameter types and return types. We all know php isn't type specfic. So for php-soap to be able to auto-generate wsdls it needs to know the types of parameters and the return values. So was looking into phpdoc and how to use that. /** Short Desc Long Desc @param name string description @param value string description @returns string description */ function do_something($name, $value) { return $name . $value; } if someone documents their code then php-soap can parse that file and pull the necessary information and genearte a wsdl from that. but that assumes that the developers are going to write their docuemntation correctly. Or i can write a script that will help the user guide thru a process of generating a wsdl. the "wizzard" will prompt them for parameters and return types. 2) php serialization / soap serialziation to and from native php and soap. Currently there is no way to override the way that it will seralize types. I do plan on creating an api to allow the users both on the client and server to override serialization. I havn't thought of a good way of doing it yet. But for the most part im pretty sure you wont need this. The way it currently works right now is. your wsdl defines this <schema> <s:element name="someObject"> <s:complexType> <s:element type="s:string" name="memberOne"> <s:element type="s:string" name="memberTwo"> </s:complexType> </s:element> </schema> and you have this code $server = new SoapServer(); $server->addFunction("returnSomeObject"); $server->bind("/wsdl/location/test.wsdl"); $server->handle(); function returnSomeObject() { $ret->memberOne = 'test'; $ret->memberTwo = 'test'; $ret->memberThree = 'test'; $ret->memberFour = 'test'; return ret; } now anytime someone invokes returnSomeObject it will only serialize memberOne and memberTwo and leave out memberFour and memberFive. and again with types it will auto convert types to the correct values. and with i don't know if you have seen SoapVar. But you can do something like this function getDateTime() { return new SoapVar(time(), XSD_DATETIME); } and that will serialize to the correct date time string that xsd defines. take alook at http://phpsoaptoolkit.sourceforge.net/phpsoap/guide/documentation/classes/soapvar/constructor/ Does this make any sence. If i still need to add a way to override serialziation then i will add it. I just need to come up with a way to give the user a way to define it. - brad > > are you talking about, for example, object creation from soap values, I mean > : how to transform a SoapValue into the apropriate PhpClass/Type ? > > I've been working a litle with the java Apache Soap implementation ... > and they use, on the client side some kind of mapping table which is a > property of each SoapClient. > > and on the server side, they use an xml file called "deployment descriptor" > to describe the java properties of the web services available on the server. > I know this server side on .Net is in the code comments likewhat you suggest > ... > > indeed, it's not really a question :) > I just wanted to know your thinking about that ... > > > ______________________________________________________________________________ > 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 > > > > _______________________________________________ > 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 |