php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68576 Namespaces in schema php_schema.c
Submitted: 2014-12-09 15:56 UTC Modified: -
Votes:11
Avg. Score:4.5 ± 0.8
Reproduced:11 of 11 (100.0%)
Same Version:7 (63.6%)
Same OS:2 (18.2%)
From: r dot eijnden at ibfd dot org Assigned:
Status: Open Package: SOAP related
PHP Version: 5.6.3 OS: RHEL5
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-12-09 15:56 UTC] r dot eijnden at ibfd dot org
Description:
------------
The schema parser in the soap extention (php_schema.c) gets confused over type attributes when these are used by multiple namespaces. In the below example WSDL the db:type attribute in the element named 'ITEM_NUMBER' causes a SOAP ERROR because the parser confuses it with a schema type. I think this is caused by 'get_attribute' , which is defined in php_xml.h as
#define get_attribute(node, name) get_attribute_ex(node, name, NULL)

A possible fix would be to replace all appropriate get_attribute(a,b) calls in php_schema.c with get_attribute_ex(a,b,SCHEMA_NAMESPACE)

Example WSDL
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/xxxoraws/w_orderws/" targetNamespace="http://xmlns.oracle.com/apps/fnd/soaprovider/plsql/xxxoraws/w_orderws/" elementFormDefault="qualified">
  <complexType name="APPS.XXXORAWS_T_ORDEX9143292X1X11">
    <sequence>
      <element name="ITEM_NUMBER" db:type="VARCHAR2" minOccurs="0" nillable="true">
        <simpleType>
          <restriction base="string">
            <maxLength value="40"/>
          </restriction>
        </simpleType>
      </element>
    </sequence>
  </complexType>
</schema>


Test script:
---------------
$x = new SoapClient('mywsdl.xml', array("trace"=>1,"exceptions"=>0,"features"=>0));


Expected result:
----------------
No output.

Actual result:
--------------
PHP Fatal error:  SOAP-ERROR: element <simpleType> has both 'type' attribute and subtype in mytest.php on line 2


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 00:01:27 2019 UTC