phpro / soap-client

A general purpose SOAP client for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<xsd:any/> in the WSDL generates a typehint to nonexistent AnyXML class

rimas-kudelis opened this issue · comments

Bug Report

Q A
BC Break no
Version 2.2.1

Summary

Nonexistent class is sometimes referenced in typehints in the generated code.

Current behavior

When the XSD in the WSDL contains references to <xsd:any/>, generated classes will typehint that property as Path\To\Namespace\AnyXML, which is a nonexistant class.

How to reproduce

Here's an excerpt from the WSDL which causes this:

      <xsd:element name="GETSKUINFOOutput">
        <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="RETURN">
                 <xsd:complexType>
                  <xsd:sequence>
                   <xsd:any/>
                  </xsd:sequence>
                 </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
      </xsd:element>

Expected behavior

I don't know what the expected behavior should be here, but I don't think referencing a nonexistent class can be it. :)

Ah yes indeed, that looks like an uncovered case. We mapped any and anyType - but it seems to have changed to anyXML somewhere.
We could map that type to mixed instead in the normalizer.
https://github.com/phpro/soap-client/blob/master/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php#L13

Closing this one - will be dealt with in #464