Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21210 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68813 invoked by uid 1010); 13 Dec 2005 21:47:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68798 invoked from network); 13 Dec 2005 21:47:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2005 21:47:00 -0000 X-Host-Fingerprint: 64.233.184.202 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.202:20721] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F4/87-49905-3514F934 for ; Tue, 13 Dec 2005 16:46:59 -0500 Received: by wproxy.gmail.com with SMTP id i2so261561wra for ; Tue, 13 Dec 2005 13:46:57 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=A/nZIst8a4wKL/1+VLhp4aNR6HmIvreXbE7Sc5ud6WBeYVX8+rBay6pN6cQC6nd+30baT2qT3yj2VLfuRzOW3EO3nzNmrws2f7bY5j7lpLMQUW0JcgQ0PSzsqcmVQ8BaUUu5w8iNcVVUFkHWCVhRTYbHqqhaqBW4jzBXSBAH/oA= Received: by 10.64.242.19 with SMTP id p19mr70752qbh; Tue, 13 Dec 2005 13:46:20 -0800 (PST) Received: by 10.65.40.15 with HTTP; Tue, 13 Dec 2005 13:46:20 -0800 (PST) Message-ID: Date: Tue, 13 Dec 2005 16:46:20 -0500 To: internals@lists.php.net In-Reply-To: <20051213213337.GK14182@desario.homelinux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <000601c60017$ffafffd0$e902a8c0@thinkpad> <20051213213337.GK14182@desario.homelinux.net> Subject: Re: [PHP-DEV] SOAP Question re: Class Mapping & Constructors From: matt.friedman@gmail.com (Matt Friedman) That sounds very good. Many thanks for the assistance. Matt. On 12/13/05, Andrew Yochum wrote: > 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 =3D new SoapClient("books.wsdl", array('classmap' =3D> > > > > array('book' =3D> "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 > -- -- Matt Friedman