I cant get this to work. I've read a bunch on it on the forum already but I just cant seem to find the solution to this.
I've created a SOAP call and its working etc but when I try to pass the same parameters multiple times it just overwrites itself wich is logical.
The code has to be done with objects only so i've used stdClass()
Example of the code below:
$relationCreate = new stdClass();
$relationCreate->credentials = new stdClass();
$relationCreate->credentials->ApiKey = ''; //Removed for security reasons.
$relationCreate->credentials->DatabaseId = ''; //Removed for security reasons.;
$relationCreate->credentials->UserId = ''; //Removed for security reasons.;
$relationCreate->parentRelationId = $company;
$relationCreate->relationEntityTypeId = "84a15869-5b88-49df-ad47-7b6f9648ae07";
//surname
$relationCreate->relationFieldValues = new stdClass();
$relationCreate->relationFieldValues->PvFieldValueData = new stdClass();
$relationCreate->relationFieldValues->PvFieldValueData->Id = "9d549512-dc8a-4774-84d1-27a349e8a8c7";
$relationCreate->relationFieldValues->PvFieldValueData->Value = $name;
// This one has to repeat wich does not work. Wich is logical
$relationCreate->relationFieldValues = new stdClass();
$relationCreate->relationFieldValues->PvFieldValueData = new stdClass();
$relationCreate->relationFieldValues->PvFieldValueData->Id = "9d549512-dc8a-4774-84d1-27a349e8a8c7";
$relationCreate->relationFieldValues->PvFieldValueData->Value = $name;
The soap should look as followed I tested this using SoapUI:
<api:fieldValues>
<!--Zero or more repetitions:-->
<api:PvFieldValueData>
<api:Id>c2fcb464-92e6-4227-8672-56f88e219279</api:Id>
<!--Optional:-->
<api:Value>Test</api:Value>
</api:PvFieldValueData>
</api:fieldValues>
<api:fieldValues>
<!--Zero or more repetitions:-->
<api:PvFieldValueData>
<api:Id>d900fe23-8549-451c-82f4-c5918cb3abbb</api:Id>
<!--Optional:-->
<api:Value>Test</api:Value>
</api:PvFieldValueData>
</api:fieldValues>
WSDL file for reference: https://api.perfectview.nl/V1/perfectview.asmx?WSDL
References: PHP SoapClient - Multiple attributes with the same key