php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64704 Problem with ASP.NET Soap Servers
Submitted: 2013-04-24 16:07 UTC Modified: 2013-04-24 17:17 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: welfordmartin at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.24 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: welfordmartin at gmail dot com
New email:
PHP Version: OS:

 

 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-24 16:09 UTC] welfordmartin at gmail dot com
Recommended Fix:

It would be nice if there was an option in setting up the SoapClient that tells it 
to use inline xmlns instead of in Envelope namespacing
 [2013-04-24 17:13 UTC] welfordmartin at gmail dot com
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);
    }
}
 [2013-04-24 17:17 UTC] welfordmartin at gmail dot com
Sorry from the work around remove the die.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC