Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

5.4: XML deserialization fails for deep XML nesting #592

Closed
jcookems opened this Issue Jul 24, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

jcookems commented Jul 24, 2012

When upgrading to PHP 5.4, the Tests\Unit\WindowsAzure\ServiceRuntime\RoleEnvironmentTest::testGetCurrentRoleInstance test fails. The problem seems to come from the \SimpleXMLElement class.

For example, this XML:

<RoleEnvironment>
  <CurrentInstance>
    <Endpoints>
      <Endpoint name="HttpIn" address="10.114.250.21" port="80" protocol="tcp" />
    </Endpoints>
  </CurrentInstance>
</RoleEnvironment>

is converted into this object in PHP 5.3

class SimpleXMLElement#1976 (3) {
  public $CurrentInstance => class SimpleXMLElement#1974 (4) {
    public $Endpoints => class SimpleXMLElement#1970 (1) {
      public $Endpoint => class SimpleXMLElement#1968 (1) {
        ...
      }
    }
  }
}

but is converted into this in PHP 5.4:

class SimpleXMLElement#1976 (3) {
  public $CurrentInstance => class SimpleXMLElement#1974 (4) {
    public $Endpoints => class SimpleXMLElement#1970 (1) {
      class SimpleXMLElement#1968 (1) {
        ...
      }
    }
  }
}

Note that the SimpleXMLElement#1968 is unnamed. This causes problems when subsequent code looks for the $Endpoint item, ultimately resulting in the failure of testGetCurrentRoleInstance (and I think also causes problems for the ContainerACL::create code, which looks for $parsed['SignedIdentifier'], which is missing, probably because it is unnamed in PHP 5.4)

Member

matt-gibbs commented Jul 29, 2014

Closing stale issues. Reactivate if it should be reconsidered.

@matt-gibbs matt-gibbs closed this Jul 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment