|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62817 elementFormDefault="qualified" without uri fails
Submitted: 2012-08-14 15:01 UTC Modified: 2012-08-14 16:02 UTC
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: ken at readywireless dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.4.5 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-08-14 15:01 UTC] ken at readywireless dot com
When using the SOAP client with a WSDL that defines a portion of the schema with elementFormDefault="qualified", but without a URI for the namespace, using _soapCall() fails for any request that contains complex elements from that portion of the schema. It appears that direct children are handled correctly (left in the default namespace), but further ancestors are being prefixed with a namespace that has a blank URI. This is conjecture, as all I can see is a soapfault of Bad Request.

Test script:

$Server=new SoapClient($_WsdlUri, array('trace' => true));

$sessionstart->UserInfo->UserName = 'user_name';
$sessionstart->UserInfo->Password = 'password';

$result = $Server->__soapCall('SessionStart', array($sessionstart));

$getproducts->GetProductsRequest->UserInfo->UserName = 'user_name';
$getproducts->GetProductsRequest->UserInfo->Password = 'password';
$getproducts->GetProductsRequest->ClientReferenceData->Service = 'pinless_dialing';

$result = $Server->__soapCall('GetProducts', array($getproducts));

Expected result:
SOAP responses (albeit login failures for both in the example above)

Actual result:
SOAP response for SessionStart, 'BAD REQUEST' error for GetProducts

Replacing the example WSDL with the URI to the following script generates correct behavior:

$url ='';
$wsdl = file_get_contents($url);
$pattern = '#<s:schema elementFormDefault="qualified">#';
$wsdl = preg_replace($pattern, '<s:schema>', $wsdl);
print ($wsdl);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-14 16:02 UTC] ken at readywireless dot com
The bad code does send a SOAP request:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="" xmlns:ns2=""><SOAP-ENV:Body><ns2:GetProducts><GetProductsRequest><ns1:UserInfo UserName="user_name" Password="password"/><ns1:ClientReferenceData Service="pinless_dialing"/></GetProductsRequest></ns2:GetProducts></SOAP-ENV:Body></SOAP-ENV:Envelope>

Notice the ns1: namespace elements, which refer to a blank namespace.
 [2013-08-28 19:54 UTC] msajadi824 at hotmail dot com
Use this wsdl instead of previous wsdl:

this wdsl has not problem and work prefect.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 23 08:01:28 2024 UTC