From:
Operating system: LINUX (CentOS)
PHP version: 5.3.10
Package: SOAP related
Bug Type: Bug
Bug description:PHP/SOAP does not interpret xsd:redefine syntax
Description:
------------
For our customers, we provide a common api including customer-specific
endpoints. These endpoints are created with JAX-WS from manually defined
XSDs and WSDLs. The structure of each end point is as follows:
* <CustomerName>_<CountryCode>.wsdl
* <CustomerName>_<CountryCode>.xsd
* <CustomerName>_<CountryCode>_Types.xsd
* Base_Types.xsd
The WSDL only defines the SOAP methods whereas the
<CustomerName>_<CountryCode>.xsd references the data structure for the
specific customer interface. BaseTypes.xsd is a common data definition
file, that is partly redefined within the
<CustomerName>_<CountryCode>_Types.xsd file using the xs:redefine
mechanism.
Unfortunately, we are facing an issue with this structure since data types
that are redefined within the <CustomerName>_<CountryCode>_Types.xsd file
are ignored during request generation. Given the structure
<typ:AuthenticateRequest>
<typ1:ConsumerIdentification>
<typ1:ConsumerAuthentication>
<typ1:Principal>...</typ1:Principal>
<typ1:Credential>...</typ1:Credential>
</typ1:ConsumerAuthentication>
</typ1:ConsumerIdentification>
<typ:Authentication>
<typ1:Identification>
<typ1:Alias>...</typ1:Alias>
</typ1:Identification>
<typ1:Security>
<typ1:SecretType>...</typ1:SecretType>
<typ1:Secret>...</typ1:Secret>
</typ1:Security>
</typ:Authentication>
</typ:AuthenticateRequest>
the ConsumerIdentification and Authentication elements are defined within
the BaseTypes.xsd and are redefined (in this case defined more precisely)
within the <CustomerName>_<CountryCode>_Types.xsd. Setting up a request
with
$requestParams = array(
'ConsumerIdentification' => array(
'ConsumerAuthentication' => array(
'Principal' => $this->authentication->getPrincipal(),
'Credential' => $this->authentication->getCredential()
)
),
'Authentication' => array(
'Identification' => array(
'Alias' => $alias
),
'Security' => array(
'SecretType' => 2,
'Secret' => $secret
)
)
);
results in an XML structure that lacks the details of the redefined data
structure. The request XML is as follows:
<typ:AuthenticateRequest>
<typ1:ConsumerIdentification />
<typ:Authentication />
</typ:AuthenticateRequest>
Obviously, this is not a sufficent input for the web service and it
complains about missing consumer credentials.
>From my point of view, this is a none-feature of the PHP/SOAP
implementation since merging the content within the xs:redefine block of
the <CustomerName>_<CountryCode>_Types.xsd into the BaseTypes.xsd solves
this issue.
Test script:
---------------
In case more information in the XSDs or WSDLs are needed, please contact
me. At present, I am not allowed to publish them for security reasons.
Regarding the SoapClient: it is created as described within the PHP docs.
Nothing special there.
Expected result:
----------------
<typ:AuthenticateRequest>
<typ1:ConsumerIdentification>
<typ1:ConsumerAuthentication>
<typ1:Principal>...</typ1:Principal>
<typ1:Credential>...</typ1:Credential>
</typ1:ConsumerAuthentication>
</typ1:ConsumerIdentification>
<typ:Authentication>
<typ1:Identification>
<typ1:Alias>...</typ1:Alias>
</typ1:Identification>
<typ1:Security>
<typ1:SecretType>...</typ1:SecretType>
<typ1:Secret>...</typ1:Secret>
</typ1:Security>
</typ:Authentication>
</typ:AuthenticateRequest>
Actual result:
--------------
<typ:AuthenticateRequest>
<typ1:ConsumerIdentification />
<typ:Authentication />
</typ:AuthenticateRequest>
--
Edit bug report at https://bugs.php.net/bug.php?id=61343&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61343&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61343&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61343&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61343&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61343&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61343&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61343&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61343&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61343&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61343&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61343&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61343&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61343&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61343&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61343&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61343&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61343&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61343&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61343&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61343&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61343&r=mysqlcfg