|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2006-11-29 08:57 UTC] mfp@php.net
 Description:
------------
Whenever the we use the soapclient to load WSDL we have generated we get a SoapFault with the text:
"[WSDL] SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <address> "
The root cause seems to be that the WSDL has changed between 1.0.4.and 1.1.0. 
The reproduce code generates a small amount of WSDL. The <address> element is created in the SOAP namespace and in 1.0.4 output it is prefaced with "tns2:", in the 1.1.0 output it is not. Possibly this is still correct WSDL, I don't know, but anyway the net effect is that the PHP soap client will not load this WSDL and the SOAP half of SCA does not work.
Reproduce code:
---------------
<?php
// you also need the three xsds out of SCA
define('SOAP_NAMESPACE', 'http://schemas.xmlsoap.org/wsdl/soap/');
$xmldas        = SDO_DAS_XML::create('wsdl-all.xsd');
$wsdl_doc      = $xmldas->createDocument();
$wsdl          = $wsdl_doc->getRootDataObject();
$service       = $wsdl->createDataObject('service');
$port          = $service->createDataObject('port');
$soap_address  = $xmldas->createDataObject(SOAP_NAMESPACE, 'tAddress');
$soap_address->location = 'http://example.com';
$port->address = $soap_address;
echo phpversion('sdo') . "\n";
echo $xmldas->saveString($wsdl_doc,2);
?>
Expected result:
----------------
this is what we get with 1.0.4
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xsi:type="tDefinitions" xmlns:tns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns2="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <service>
    <port>
      <tns2:address xsi:type="tAddress" location="http://example.com"/>
    </port>
  </service>
</definitions>
Actual result:
--------------
this is what we get with 1.1.0
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns2="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <service>
    <port>
      <address xsi:type="tns2:tAddress" location="http://example.com"/>
    </port>
  </service>
</definitions>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 15:00:01 2025 UTC | 
For info, the second of the SCA samples that we ship also catches this: Calling a remote SCA component using a PHP script. Attempting to access HelloService, to trigger the automatic generation of WSDL for this component... Calling HelloService as a Web service... Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <address> in c:\php\PEAR\SCA\SCA_SoapProxy.php:136 Stack trace: #0 c:\php\PEAR\SCA\SCA_SoapProxy.php(136): SoapClient->SoapClient('C:\Program File...', Array) #1 c:\php\PEAR\SCA\SCA.php(241): SCA_SoapProxy->__construct('C:\Program File...') #2 C:\Program Files\Apache Group\Apache2\htdocs\Samples\ScriptCallingRemoteSCAComponent\HelloClient.php(37): SCA::getService('./HelloService....') #3 {main} thrown in c:\php\PEAR\SCA\SCA_SoapProxy.php on line 136