I am trying to connect to a service bus queue in Microsoft Azure using PHP, using the following code found on the Azure guide:
<?php
require_once 'vendor/autoload.php';
use MicrosoftAzure\Storage\Queue\QueueRestProxy;
use MicrosoftAzure\Storage\Common\Exceptions\ServiceException;
use MicrosoftAzure\Storage\Queue\Models\CreateMessageOptions;
$connectionString = "DefaultEndpointsProtocol=https;AccountName="name";AccountKey=key";
// Create queue REST proxy.
$queueClient = QueueRestProxy::createQueueService($connectionString);
try{
// Create message.
$builder = new ServicesBuilder();
$queueClient->createMessage("cmps297r1", "Hello World!");
}
catch(ServiceException $e){
// Handle exception based on error codes and messages.
// Error codes and messages are here:
// http://msdn.microsoft.com/library/azure/dd179446.aspx
$code = $e->getCode();
$error_message = $e->getMessage();
echo $code.": ".$error_message."<br />";
}
?>
However, when I run it, I get this error:
Catchable fatal error: Argument 4 passed to MicrosoftAzure\Storage\Common\Internal\ServiceRestProxy::__construct() must be an instance of MicrosoftAzure\Storage\Common\Internal\Serialization\ISerializer, array given, called in /Applications/XAMPP/xamppfiles/htdocs/297R/vendor/microsoft/azure-storage/src/Queue/QueueRestProxy.php on line 110 and defined in /Applications/XAMPP/xamppfiles/htdocs/297R/vendor/microsoft/azure-storage/src/Common/Internal/ServiceRestProxy.php on line 77