note 93937 added to soapserver.soapserver

From: Date: Wed, 07 Oct 2009 15:31:46 +0000
Subject: note 93937 added to soapserver.soapserver
Groups: php.notes 
Request: Send a blank email to php-notes+get-161473@lists.php.net to get a copy of this message
typemap isn't very well documented at all, but I thought I might be able to use it to clean some things up and map between object fields and XML attributes that have different names but are conceptually the same thing. Unfortunately type map works at the object level, not the field level like I was hoping, requiring you to provide functions for building the entire object from an XML string (using the XML parser of your choice) and vice versa. I found the wording of the docs very confusing, both parameters are strings which are function names. the to_xml function will take the object as a parameter and return a string, the from_xml function will take an xml string as a parameter and should return an object of the correct type. Both methods can also throw SOAPFaults or other exceptions which can be caught from the actual client method call ($client->someRemoteMethod()) There are decent usage examples in the PHP build tests: http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/?diff_format=u The typemap tests are at the bottom. ---- Server IP: 64.71.164.2 Probable Submitter: 192.223.243.6 ---- Manual Page -- http://www.php.net/manual/en/soapserver.soapserver.php Edit -- https://master.php.net/note/edit/93937 Del: integrated -- https://master.php.net/note/delete/93937/integrated Del: useless -- https://master.php.net/note/delete/93937/useless Del: bad code -- https://master.php.net/note/delete/93937/bad+code Del: spam -- https://master.php.net/note/delete/93937/spam Del: non-english -- https://master.php.net/note/delete/93937/non-english Del: in docs -- https://master.php.net/note/delete/93937/in+docs Del: other reasons-- https://master.php.net/note/delete/93937 Reject -- https://master.php.net/note/reject/93937 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#161473) next »