I am working on a SOAP client in PHP, and the calls are going through to the service fine, with the exception of calls where there are elements that are identical to each ot
Hello You can try this fix:
You need to extends the SoapClient and fix the generated request:
You need to add the tags that are causing problems here
$tags = ['Tag1', 'Tag2', 'Tag3'];
And then use the MySoapClient instead of SoapClient
class MySoapClient extends SoapClient {
public function __construct($a, $b){
parent::__construct($a, $b);
}
public function __doRequest($request, $location, $action, $version, $one_way = 0) {
$tags = ['Tag1', 'Tag2', 'Tag3'];
foreach($tags as $tag){
if (preg_match("~(.+) ~ismU", $request, $matches)) {
$ref = $matches[1];
$request = str_replace([' id="ref'.$ref.'"'], '', $request);
$tagValue = "{$matches[2]} ";
$request = str_replace("", $tagValue, $request);
}
}
return parent::__doRequest($request, $location, $action, $version);
}
}