From: ken at readywireless dot com Operating system: Windows XP PHP version: 5.4.5 Package: SOAP related Bug Type: Bug Bug description:elementFormDefault="qualified" without uri fails
Description: ------------ 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: --------------- <?php $_WsdlUri='http://169.132.165.178/b2bapi/b2bservice.asmx?WSDL'; $Server=new SoapClient($_WsdlUri, array('trace' => true)); $sessionstart->UserInfo->UserName = 'user_name'; $sessionstart->UserInfo->Password = 'password'; $result = $Server->__soapCall('SessionStart', array($sessionstart)); print_r($result); $getproducts->GetProductsRequest->UserInfo->UserName = 'user_name'; $getproducts->GetProductsRequest->UserInfo->Password = 'password'; $getproducts->GetProductsRequest->ClientReferenceData->Service = 'pinless_dialing'; $result = $Server->__soapCall('GetProducts', array($getproducts)); print_r($result); ?> 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: <?php $url ='http://169.132.165.178/b2bapi/b2bservice.asmx?WSDL'; $wsdl = file_get_contents($url); $pattern = '#<s:schema elementFormDefault="qualified">#'; $wsdl = preg_replace($pattern, '<s:schema>', $wsdl); print ($wsdl); ?> -- Edit bug report at https://bugs.php.net/bug.php?id=62817&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62817&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62817&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62817&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62817&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62817&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62817&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62817&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62817&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62817&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62817&r=support Expected behavior: https://bugs.php.net/fix.php?id=62817&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62817&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62817&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62817&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62817&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62817&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62817&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62817&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62817&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62817&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62817&r=mysqlcfg