SoapClient: how to pass multiple elements with same name?
Fixed it by extends SoapClient and overrides __doRequest() method where I modify request as descibed here: http://www.php.net/manual/en/soapclient.dorequest.php#57995
Looks terrible for me, but it works "right here, right now".
PHP SOAP: Passing the same parameters with the same name
You can try to put the items into an array.
Example:
$relationCreate->relationFieldValues = [];
// repeat this in a foreach loop:
$item = new stdClass();
$item->PvFieldValueData = new stdClass();
$item->PvFieldValueData->Id = $uuid;
$item->PvFieldValueData->Value = $name;
// Add item to values
$relationCreate->relationFieldValues[] = $item;
PHP SoapClient - Multiple attributes with the same key
The ContactProfileAttribute
element is one level too deep. Try:
$params = array(
'WSContact' => array(
'EmailAddress' => $email,
'ListID' => $listId,
'ContactProfileAttribute' => $attrs
),
'ProfileUpdateType' => 'Overwrite',
'ExternalEventIDs' => "",
'OverrideUnsubscribe' => TRUE,
);
Send data to SOAP API involving repeated elements of same name
You are overriding the properties
key:
$a = [
'properties' => [
'name' => 'invtype',
'value' => 'foo'
],
'properties' => [
'name' => 'item_number',
'value' => 'foo'
],
];
This will leave the last entry only.
Make the value of the properties
key an array:
$a = [
'properties' => [
[
'name' => 'invtype',
'value' => 'foo'
],
[
'name' => 'item_number',
'value' => 'foo'
],
],
];
Related Topics
Select Statement with Fetch_Array in MySQLi Prepared Statements
Php: What Is the Purpose of Session_Name
How to Inject a Service in Another Service in Symfony
Class App\Http\Controllers\Usercontroller Does Not Exist
Different Recipients Based on Product Category in Woocommerce Email Notification
PHP - Override Existing Function
What's the Best and Easiest Way to Populate a Dropdown Based on Another Dropdown
How Does Codeigniter Receive the Ajax Post Data in Controller
Why Is My Database Backup Script Not Working in PHP
Laravel Expected Response Code 250 But Got Code "530"
Converting Dates with PHP for Datetime in SQL
Namevaluepair Error "Namevaluepair Cannot Be Resolved to a Type"