473,804 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP5 and arrays of complextype

Hi,

I am currently having the exact same problem as described here:

http://bugs.php.net/bug.php?id=36226

The webservice is configured to return 0-* objects of a complextype,
but when only one single item is returned, it does not get deserialized
as an array as I would expect, but as a single object.

The new feature proposed on the bottom of the above page does not seem
to be included in our installed version of PHP 5.1.2-1.

Is there any other way to change this behaviour.

Kind regards.

Jan 11 '07 #1
3 1534

"Gerry Vandermaesen" <ge************ ****@gmail.comw rote in message
news:11******** **************@ i56g2000hsf.goo glegroups.com.. .
| Hi,
|
| I am currently having the exact same problem as described here:
|
| http://bugs.php.net/bug.php?id=36226
|
| The webservice is configured to return 0-* objects of a complextype,
| but when only one single item is returned, it does not get deserialized
| as an array as I would expect, but as a single object.
|
| The new feature proposed on the bottom of the above page does not seem
| to be included in our installed version of PHP 5.1.2-1.
|
| Is there any other way to change this behaviour.
|
| Kind regards.

$complexType = yourCallToWebSe rvice;
if (!is_array($com plexType)){ $complexType = array($complexT ype); }

perhaps? haven't played with that too much.
Jan 11 '07 #2
Steve wrote:
"Gerry Vandermaesen" <ge************ ****@gmail.comw rote in message
news:11******** **************@ i56g2000hsf.goo glegroups.com.. .
| Hi,
|
| I am currently having the exact same problem as described here:
|
| http://bugs.php.net/bug.php?id=36226
|
| The webservice is configured to return 0-* objects of a complextype,
| but when only one single item is returned, it does not get deserialized
| as an array as I would expect, but as a single object.
|
| The new feature proposed on the bottom of the above page does not seem
| to be included in our installed version of PHP 5.1.2-1.
|
| Is there any other way to change this behaviour.
|
| Kind regards.

$complexType = yourCallToWebSe rvice;
if (!is_array($com plexType)){ $complexType = array($complexT ype); }

perhaps? haven't played with that too much.

Because it is an array of arrays, simply checking is_array will always
return true.
Now assuming that the second array is associated array as described in
the bugs,
the following code **might** do the trick

$complexType = yourCallToWebSe rvice;
if(array_key_ex ist('id', $complexType)) $complexType = array($complexT ype);

Hendri Kurniawan
Jan 11 '07 #3

"Hendri Kurniawan" <as****@email.c omwrote in message
news:12******** *****@corp.supe rnews.com...
| Steve wrote:
| "Gerry Vandermaesen" <ge************ ****@gmail.comw rote in message
| news:11******** **************@ i56g2000hsf.goo glegroups.com.. .
| | Hi,
| |
| | I am currently having the exact same problem as described here:
| |
| | http://bugs.php.net/bug.php?id=36226
| |
| | The webservice is configured to return 0-* objects of a complextype,
| | but when only one single item is returned, it does not get
deserialized
| | as an array as I would expect, but as a single object.
| |
| | The new feature proposed on the bottom of the above page does not seem
| | to be included in our installed version of PHP 5.1.2-1.
| |
| | Is there any other way to change this behaviour.
| |
| | Kind regards.
| >
| $complexType = yourCallToWebSe rvice;
| if (!is_array($com plexType)){ $complexType = array($complexT ype); }
| >
| perhaps? haven't played with that too much.
| >
| >
|
| Because it is an array of arrays, simply checking is_array will always
| return true.

interesting. i had thought that if $complexType was nothing (an unitialized
array for instance), that declaring an array initialized with nothing
(uninitialized array - $complexType) would make the array be likewise
uninitialized. i'll have to check that...just hadn't run across that before.
thanks for the heads-up.

Jan 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
4729
by: Terje Slettebø | last post by:
To round off my trilogy of "why"'s about PHP... :) If this subject have been discussed before, I'd appreciate a pointer to it. I again haven't found it in a search of the PHP groups. The PHP manual mentions "overloading" (http://no.php.net/manual/en/language.oop5.overloading.php), but it isn't really overloading at all... Not in the sense it's used in other languages supporting overloading (such as C++ and Java). As one of the...
0
2053
by: Ville Mattila | last post by:
Hello readers, I'm having problems with arrays in SOAP requests. The WSDL definition below does not seem to work, i.e. the ContactList object is not accessible in VB.NET. Contact object works correctly. <types> <xsd:schema targetNamespace="http://localhost/soaptest"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
0
2041
by: John Harvey | last post by:
I have been struggling with the following: I want to create a class that contains an array of some user-defined type. so I have the following vb code: Public Class Communications Public PhoneInfo() As ACORD.PhoneInfo End Class Public Class PhoneInfo Public PhoneNumber As String
1
1921
by: Istvan | last post by:
Hi ! Can somebody tell me if it's possible to overwrite an element definition when I derive an complexType (with extension, or something like this ) ? The base complexType looks like: <xs:complexType name="statechangetype"> <xs:sequence>
0
1053
by: dchappelle | last post by:
Hi, I used wsdl.exe to generate a C# client proxy - included is a piece of the wsdl file of interest... <complexType name="GetSubscriberListEntry"> <sequence> <element name="ServiceId" type="unsp:ServiceId" minOccurs="0" maxOccurs="1" nillable="true"/> <element name="ServiceIdType" type="unsp:ServiceIdType" minOccurs="1"
2
2694
by: Summercool | last post by:
I wonder in PHP5, can we use $array1 = $array2 as if it is a class? i think right now, the whole array is copied (by key and value)... and i want to assign by reference but NOT in the alias sense. in other world, i want to say
30
1913
by: Logos | last post by:
I have what may be a bug, or may be a misunderstanding on how pass by reference and class inheritance works in PHP. Since I'm relatively new to PHP, I'm hoping for a little outside help to shed some light on this! (code abbreviated for clarity) I have a parent class, DetailCollection, with a child class KeycodeTracker:
0
1804
by: vpal61 | last post by:
Hello, I have an Excel/VBA web service client with SOAP Toolkit, consuming Apache Tomcat webservice, which is working fine. Now I am trying to migrate to .NET, and build client in VS2005 with VSTO in C#. The problem is that all array types as returned by client are empty (simple types are OK). Any help very appreciated. Thanks, Vadim
14
1727
by: Jeff | last post by:
I'm working on a server that is running PHP4. I'd like to upgrade this so I can use the PHP5 code I have already. What kind, if any, problems will I have with the existing PHP code base? I see: Local Master
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.