|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-04-24 16:07 UTC] welfordmartin at gmail dot com
Description: ------------ This might want changing to a Feature Request instead of bug but I'm not sure. There is a problem in ASP.NET SOAP Server that for some reason does not support using the Envelope xmlns:ns stuff inside the soap:header this is how php SoapClient works <soap:Envelope ... xmlns:ns1="" xmlns:ns2=""> ASP.NET uses <soap:header> <Method xmlns=""> </Method> </soap:header> Please look at "The Test Scripts" for the problem that occures these are not the php code but the payload generated by SoapClient and the manual modifications i had to to to get the code to work on my REST Testing client. Test script: --------------- Working: http://pb.mgawow.co.uk/yvxCQe2S Not Working PHP SoapClient Generated: http://pb.mgawow.co.uk/r9xjaEW4 Expected result: ---------------- Working API Call Actual result: -------------- Fails causes a 500 error on remote server called PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 09:00:02 2025 UTC |
Work Around for time being. class NewSoapClient extends SoapClient{ public function __doRequest($request, $location, $action, $version, $one_way = 0) { preg_match_all("/xmlns:ns([0-9*])=\"(.[^\\\"]*)\\\"/", $request, $env); foreach($env[0] as $key => $val){ $request = str_replace($val, "", $request); preg_match_all("/<ns".$env[1][$key].":([A-Za-z][A-Za-z0- 9]*)/", $request, $test); foreach($test[0] as $k => $v){ $request = str_replace($v, "<".$test[1][$k]." xmlns=\"".$env[2][$k]."\"", $request); $request = str_replace(str_replace("<", "</", $test[0][$k]), "</".$test[1][$k], $request); } } die(print_r(array($request, $test), true)); // parent call return parent::__doRequest($request, $location, $action, $version); } }