php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63357 Notice: Array to string conversion
Submitted: 2012-10-25 09:13 UTC Modified: -
Votes:8
Avg. Score:3.8 ± 1.4
Reproduced:6 of 7 (85.7%)
Same Version:3 (50.0%)
Same OS:2 (33.3%)
From: thomas dot lallement at 9online dot fr Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.18 OS: Ubuntu 12.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-10-25 09:13 UTC] thomas dot lallement at 9online dot fr
Description:
------------
Hi,

I found a problem when calling a method of a web service with a parameter defined like this:

<xsd:complexType name="FormDefinitionTO">
    <xsd:sequence>
        <xsd:element maxOccurs="unbounded" minOccurs="0" name="activeEmails" nillable="true" type="xsd:string"/>
    </xsd:sequence>
</xsd:complexType>

When I call like this, it works. I receive an object with a list of activeEmails:

public function testList() {
    $formDefinitionTO = new FormDefinitionTO();
    $formDefinitionTO->activeEmails = array('0' => 'test 1', '0' => 'test 2');
    $user = $this->soapClient->testList($formDefinitionTO);
}

But if I change the array keys (for example):

public function testList() {
    $formDefinitionTO = new FormDefinitionTO();
    $formDefinitionTO->activeEmails = array('1' => 'test 1', '2' => 'test 2');
    $user = $this->soapClient->testList($formDefinitionTO);
}

I have the following error Notice: Array to string conversion




Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC