Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21209 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62080 invoked by uid 1010); 13 Dec 2005 21:36:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62065 invoked from network); 13 Dec 2005 21:36:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2005 21:36:01 -0000 X-Host-Fingerprint: 147.202.47.146 cruiser.plexpod.net Linux 2.5 (sometimes 2.4) (4) Received: from ([147.202.47.146:35647] helo=cruiser.plexpod.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 50/86-49905-1CE3F934 for ; Tue, 13 Dec 2005 16:36:01 -0500 Received: from dsl254-067-175.nyc1.dsl.speakeasy.net ([216.254.67.175] helo=desario.homelinux.net) by cruiser.plexpod.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52) id 1EmHoG-0004hA-Iw; Tue, 13 Dec 2005 16:35:44 -0500 Received: by desario.homelinux.net (sSMTP sendmail emulation); Tue, 13 Dec 2005 16:33:38 -0500 Date: Tue, 13 Dec 2005 16:33:38 -0500 To: Matt Friedman , Dmitry Stogov , internals@lists.php.net Message-ID: <20051213213337.GK14182@desario.homelinux.net> References: <000601c60017$ffafffd0$e902a8c0@thinkpad> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cruiser.plexpod.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - plexpod.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] SOAP Question re: Class Mapping & Constructors From: andrew@plexpod.com (Andrew Yochum) Hi Matt & Dmitry, Calling the magic __wakeup() func might be appropriate in this case, since SOAP envelope deserialization is a lot like regular deserialization. It is a lot less confusing than calling the constructor w/ no args and seems quite appropriate given the context. Andrew On Tue, Dec 13, 2005 at 02:22:25PM -0500, Matt Friedman wrote: > Hi Dmitry, > > It is understandable that you don't know what the arguments might be. > But I would rather have the constructor called with no arguments, or > with just the std object `book` passed to the constructor instead of > no constructor at all. > > Is it possible? > > Thanks, > Matt. > > > > On 12/13/05, Dmitry Stogov wrote: > > Hi Matt, > > > > During SOAP envelope deserialization, objects are created indirectly. > > So constructors are not called (constructor may need arguments). > > > > This is not a bug. > > > > Thanks. Dmitry. > > > > > -----Original Message----- > > > From: Matt Friedman [mailto:matt.friedman@gmail.com] > > > Sent: Tuesday, December 13, 2005 9:49 PM > > > To: internals@lists.php.net > > > Subject: [PHP-DEV] SOAP Question re: Class Mapping & Constructors > > > > > > > > > Hi, > > > > > > We are using the built-in SOAP extension. > > > > > > From the docs: > > > $server = new SoapClient("books.wsdl", array('classmap' => > > > array('book' => "MyBook"))); > > > > > > Soap server will return a complex data type 'book'. The data > > > fields for book will be mapped to the php class' data fields > > > in MyBook. It seems that the constructor for MyBook is never > > > called (according to our tests). The data fields are mapped > > > somehow internally. > > > > > > If I want MyBook to be much more than just a data container, > > > then I can foresee that I will often want/need a constructor > > > but __construct is not called. > > > > > > Could this be considered a bug? Any thoughts? > > > > > > -- > > > -- Matt Friedman > > > > > > -- > > > PHP Internals - PHP Runtime Development Mailing List > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > -- Matt Friedman > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Andrew Yochum Plexpod andrew@plexpod.com 718-360-0879