Empty string != null

From: Date: Thu, 10 Apr 2003 12:24:18 +0000
Subject: Empty string != null
Groups: php.soap 
Request: Send a blank email to php-soap+get-537@lists.php.net to get a copy of this message
Hi all, I'm calling a webservice which may or may not return an array "MedicalRecordEntryList" of record entries "MedicalRecordEntry". <soap:Body> <GetMemberMedicalRecordEntryListResponse xmlns="http://www.medvisor.co.uk/services"> <GetMemberMedicalRecordEntryListResult> <MedicalRecordEntryList /> </GetMemberMedicalRecordEntryListResult> </GetMemberMedicalRecordEntryListResponse> </soap:Body> <soap:Body> <GetMemberMedicalRecordEntryListResponse xmlns="http://www.medvisor.co.uk/services"> <GetMemberMedicalRecordEntryListResult> <MedicalRecordEntryList> <MedicalRecordEntry> <EntryDateTime>10 April 2003</EntryDateTime> <EventDate>02 January 2002</EventDate> <ConceptType>Medication</ConceptType> <ClinicalCode>x01IH</ClinicalCode> <PreferredTermCode>y045V </PreferredTermCode> <PreferredTermString>Oral tetracycline</PreferredTermString> <PreferredLayTermString>Unknown</PreferredLayTermString> <ConceptCode>x01IH</ConceptCode> <SupplementaryCode>(Unknown)</SupplementaryCode> <Narrative>Antibiotics</Narrative> </MedicalRecordEntry> </MedicalRecordEntryList> </GetMemberMedicalRecordEntryListResult> </GetMemberMedicalRecordEntryListResponse> </soap:Body> </soap:Envelope> The problem (I think) is that when the array is empty it should be translated to PHP as a null? However PEAR::SOAP returns: object(stdClass)(1) { ["MedicalRecordEntryList"]=> string(0) "" } Why the empty string? Is it all related to the wsdl parsing? Regards, -- Mike Carter [web developer] tel: 01925 758229 // fax: 01925 758023 // web: www.koa.uk.com This message is confidential. Unless you are the named addressee or their delegated representative you may not use, disclose, or copy the contents of the e-mail. If you are not the named addressee please notify the sender immediately and delete the material from your computer. Any views or opinions contained in this e-mail are solely those of the author unless expressly stated otherwise ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

« previous php.soap (#537) next »