-
Notifications
You must be signed in to change notification settings - Fork 0
/
soap_client_finding.php
29 lines (24 loc) · 984 Bytes
/
soap_client_finding.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace macropage\ebaysdk\base;
class soap_client_finding extends \SoapClient {
public function __construct($wsdl, array $options = null) {
$new_options = [];
foreach ($options as $key => $data) {
if (strpos($key,'wsdl_',0)!==false) {
$new_options[substr($key,5)] = $data;
} else {
$new_options[$key] = $data;
}
}
parent::__construct($wsdl, $new_options);
}
public function __doRequest($request, $location, $action, $version, $one_way = 0) {
preg_match_all('/(<\/?(\w*)>)/',$request,$matches);
$toreplace = array_unique($matches[2]);
foreach ($toreplace as $node) {
$request = preg_replace('/<'.$node.'>/','<ns1:'.$node.'>',$request);
$request = preg_replace('/<\/'.$node.'>/','</ns1:'.$node.'>',$request);
}
return parent::__doRequest($request, $location, $action, $version, $one_way);
}
}