Problem with returning empty array
| From: | Javier Muniz | Date: | Wed, 06 Aug 2003 00:16:22 +0000 |
| Subject: | Problem with returning empty array | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-927@lists.php.net to get a copy of this message | ||
Hi,
I'm getting an error from VB.NET when consuming a PEAR::SOAP webservice that
sometimes returns an empty array. Everything works fine when the array is
populated, however when the array is empty I get an xml error, the wire is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:EncoderIntegrator"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4:getControlMessagesResponse>
<messages xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="[0]"/>
</ns4:getControlMessagesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Now, I'm no expert but I don't believe that '[0]' is valid for an arrayType,
is this correct? Any ideas on why that's getting in there? My return
function is doing the following ($messages is an empty array):
return new
SOAP_Value('messages','{http://granicus.com/xsd}ControlMessageList',$message
s);
ControlMessageList is defined as:
$this->__typedef['{http://granicus.com/xsd}ControlMessageList']
=
array(array('{http://granicus.com/xsd}ControlMessage'));
ControlMessage is defined as:
$this->__typedef['{http://granicus.com/xsd}ControlMessage']
=
array(
'Message' => 'string',
'AssetID' => 'int',
'Seconds' => 'int'
);
Oh, and I'm using 0.7.5
Thanks!
-Javier