|  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: -
Avg. Score:4.6 ± 0.8
Reproduced:12 of 12 (100.0%)
Same Version:8 (66.7%)
Same OS:3 (25.0%)
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: r dot eijnden at ibfd dot org
New email:
PHP Version: OS:


 [2014-12-09 15:56 UTC] r dot eijnden at ibfd dot org
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="" xmlns:db="" targetNamespace="" elementFormDefault="qualified">
  <complexType name="APPS.XXXORAWS_T_ORDEX9143292X1X11">
      <element name="ITEM_NUMBER" db:type="VARCHAR2" minOccurs="0" nillable="true">
          <restriction base="string">
            <maxLength value="40"/>

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


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Feb 25 16:01:26 2020 UTC