php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44686 SOAP-ERROR: Parsing WSDL
Submitted: 2008-04-10 23:52 UTC Modified: 2013-07-31 13:38 UTC
Votes:41
Avg. Score:4.6 ± 0.6
Reproduced:37 of 38 (97.4%)
Same Version:13 (35.1%)
Same OS:9 (24.3%)
From: dmittner at llnw dot com Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5.2.5 OS: Gentoo
Private report: No CVE-ID:
 [2008-04-10 23:52 UTC] dmittner at llnw dot com
Description:
------------
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute.

C# generated WSDL. I saw an older bug with similar characteristics, but that was 4 years old, supposedly resolved, and on a different OS. Several validators I tried are able to consume the WSDL.

Reproduce code:
---------------
<?php
  $wsdl = "http://gpn.webservice.gomez.com/GpnProvisioningService/ProvisioningWS.asmx?wsdl";
  $soap = new SoapClient($wsdl,array("trace"=>true,"features"=>SOAP_SINGLE_ELEMENT_ARRAYS));
?>

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

Actual result:
--------------
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute in /home/dmittner/temp.php:3
Stack trace:
#0 /home/dmittner/temp.php(3): SoapClient->SoapClient('http://gpn.webs...', Array)
#1 {main}
  thrown in /home/dmittner/temp.php on line 3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-11 05:54 UTC] dmittner at llnw dot com
I have also found this to occur on PHP 5.0.5, also on Gentoo.
 [2008-04-14 22:42 UTC] dmittner at llnw dot com
I've narrowed it down, I think.
Relevant excerpts from the WSDL:

<s:element name="ProvisionMonitors">      
 <s:complexType>
   <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" ref="ProvisioningOrder" />
   </s:sequence>
 </s:complexType>
</s:element>

<s:element name="ProvisioningOrder" type="ProvisioningOrder" />
<s:complexType name="ProvisioningOrder">
 <s:complexContent mixed="false">
  <s:extension base="CServiceObject">
   <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="MonitorOrders" type="ArrayOfMonitorOrder" />
    ...
   </s:sequence>
   <s:attribute name="name" type="s:string" />
   ...
  </s:extension>
 </s:complexContent> 
</s:complexType> 

No "name" is specified in the upper block of XML, for the line with the "ref=". If I specify a name the WSDL parses. I believe the correct behavior would be for PHP to acquire the name from the complexType declaration. I don't know if this should always be the case for references, or only when no name is provided - if providing a name is even valid for them.

This is just a guess, though. I've dealt very little with references so do not know the standards surrounding them; only what digging into the XML has revealed.
 [2008-10-21 11:27 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2008-10-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-11-30 18:22 UTC] olivier at quatrain dot com
Having the same problem happening with a valid WSDL on php 5.2.5 and 5.2.6, I tested it on the latest snapshot of PHP (5.2.7RC6) and got the same error.

Hope it helps.
 [2008-12-01 18:12 UTC] sergio dot aghemo at fiat dot com
having the same problem. Urgent fix needed!

follow extract of the WSDL

<s:element name="getLinkProfilesByTicketResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" ref="getLinkProfilesByTicketResult" />
          </s:sequence>
        </s:complexType>
      </s:element>

.....


      <s:element name="getLinkProfilesByTicketResult" type="LINKPROFILESRESPONSE" />
      <s:complexType name="LINKPROFILESRESPONSE">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="USER" type="USER" />
        </s:sequence>
        <s:attribute name="error" type="s:string" />
      </s:complexType>
      <s:complexType name="USER">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="CODMARKET" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="USERNAME" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="SINCOM" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="LOGINNAME" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="FIRSTNAME" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="LASTNAME" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="EMAIL" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="TELEPHONE" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="FAX" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="USERTYPE" type="s:integer" />
          <s:element minOccurs="0" maxOccurs="1" name="COMPANY" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="SAPUSERID" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="MAINSINCOM" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="STATUS" type="s:integer" />
          <s:element minOccurs="0" maxOccurs="1" name="LANGUAGE" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="APPLICATIONS" type="ArrayOfAPPLICATION" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ArrayOfAPPLICATION">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="APPLICATION" type="APPLICATION" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="APPLICATION">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ROLE" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="BRANDS" type="s:string" />
        </s:sequence>
        <s:attribute name="name" type="s:string" />
        <s:attribute name="market" type="s:string" />
        <s:attribute name="enabled" type="s:integer" />
      </s:complexType>
      <s:element name="LINKPROFILESRESPONSE" type="LINKPROFILESRESPONSE" />
 [2009-01-12 22:02 UTC] simon at connexon dot com
Hi,

I'm having the same problem... And it's a bit tough for me to troubleshoot because I'm using a file package provided by a website.

http://www.nena.org/xml_schemas/NENAFiles/CurrentNENA/CurrentNENA.zip

I'm trying to get the validateAddress to work (from the v7 interface) but so far no luck! I'm stuck on this undefined ref variable.....
 [2009-03-13 15:05 UTC] tjxlacrosse at hotmail dot com
Is anyone looking into this?  I'm having the same issue on
Ubuntu 8.10 with PHP 5.2.6-2 when trying to parse a .net web service

WSDL:http://d2c.9squared.com/f/ContentRetrieval.asmx?WSDL
 [2009-04-09 10:26 UTC] tommy at profi dot it
Same here. Test files available at

http://dev.profi.it/ota.zip

Please review this issue! Thanks a lot!
 [2010-07-05 12:35 UTC] belgattitude at gmail dot com
Same error connecting to .net service with PHP 5.2.13 and PHP 5.2.14RC2

Try it with, for example :

$url = "http://d2c.9squared.com/f/ContentRetrieval.asmx?WSDL";
$soapClient = new SoapClient($url array('soap_version' => SOAP_1_2));


will result in

[WSDL] SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute.
 [2010-11-10 11:29 UTC] php at leentje dot org
Also not working in php5.3 it seems. Why is this bug not being picked up? It kind of defeats the purpose if I have to store WSDL files locally... and even worse, also have to change/add name= to the file.
 [2010-12-02 10:09 UTC] norberto dot ostallo at qualitygroup dot it
I'm having the same problem consuming OTA (Open Travel Alliance) XML files, using php5.3.3 on Ubuntu.
Does anyone know a fix or a workaround?
 [2011-07-04 10:27 UTC] felix at hexon dot cx
Im am experiencing the same problem with a .NET webservice using the 'ref' attribute in the WSDL.

PHP version 5.3.6
 [2011-08-15 18:36 UTC] jeremy at techtrav dot com
Also experiencing the issue with PHP 5.3 using the OTA ( Open Travel Alliance  ) WSDL.  Honestly if this has been an issue since 5.0.5, it should be fixed by now.  Adding name="name" in front of ref=" in all of the XSD's allows the parser to succeed but it technically is an invalid WSDL.  I hope there is a real fix for this glaring WSDL parsing bug soon.
 [2011-11-14 06:36 UTC] dmitry@php.net
-Assigned To: +Assigned To: dmitry
 [2011-11-14 08:42 UTC] dmitry@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=319151
Log: Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references)
 [2011-11-14 08:43 UTC] dmitry@php.net
-Status: No Feedback +Status: Closed
 [2011-11-14 08:43 UTC] dmitry@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2011-11-18 01:28 UTC] mykel at xtreme dot com dot au
just a heads up everyone: most of these issues can be resolved by changing 

<xs:include schemaLocation="Schema_File.xsd"/>

to 

<xs:import schemaLocation="Schema_File.xsd"/>

you will of course need to be using local WSDL/XSD files, which shouldn't be a problem for OTA requests.
 [2012-04-18 09:47 UTC] laruence@php.net
Automatic comment on behalf of dmitry
Revision: http://git.php.net/?p=php-src.git;a=commit;h=52deaeb8c0dcba1322ac84b23831baa8f796f457
Log: Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references)
 [2012-07-24 23:38 UTC] rasmus@php.net
Automatic comment on behalf of dmitry
Revision: http://git.php.net/?p=php-src.git;a=commit;h=52deaeb8c0dcba1322ac84b23831baa8f796f457
Log: Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references)
 [2012-12-23 10:08 UTC] terenzio at tiscali dot it
Still getting

SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute

whith PHP 5.3.14 (cli) (built: Jun 19 2012 03:47:42) on CENTOS

while parsing a WSDL containing 

<xs:attributeGroup ref="TelephoneInfoGroup">
<xs:annotation>
<xs:documentation source="Description" xml:lang="en">
Information about a telephone number, including the actual number and its usage.
</xs:documentation>
</xs:annotation>
</xs:attributeGroup>

removing ref= and replacing with name= solves the problem but this fix cannot be applied on remote WSDL and leads to potentially invalid WSDL
 [2012-12-24 08:56 UTC] dmitry@php.net
In case this WSDL file doesn't contain an attributeGroup with name="TelephoneInfoGroup" it's definitely wrong WSDL.

You may provide a complete WSDL/XSD example to prove if it's a bug in ext/soap.
 [2013-07-31 13:38 UTC] dmitry@php.net
I've committed an additional fix into PHP-5.4 and above
 [2013-11-17 09:35 UTC] laruence@php.net
Automatic comment on behalf of dmitry
Revision: http://git.php.net/?p=php-src.git;a=commit;h=52deaeb8c0dcba1322ac84b23831baa8f796f457
Log: Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 17:01:54 2014 UTC