The issue might be with how you’re passing the XML data
in the request body. In the wp_remote_post
function try this”
$xmlCustomerDataByAuthorLicenseID = '<GetCustomerDataByAuthor><AuthorID>ABC123</AuthorID></GetCustomerDataByAuthor>';
$response = wp_remote_post(
$urlCustomerDataByAuthor,
array(
'method' => 'POST',
'headers' => array(
'Content-Type' => 'text/xml'
),
'body' => $xmlCustomerDataByAuthorLicenseID,
'sslverify' => false
)
);
if (wp_remote_success($response)) {
$xmlDataParsed = simplexml_load_string($response['body']);
foreach ($xmlDataParsed->{"Customer"} as $individualCustomer) {
$customerEmail = strtolower(trim($individualCustomer->Email));
}
}