1
votes

Does the current Azure SDK for PHP supports Service Bus for Windows Server 1.1? And if it does, how it should be configured in order to successfully connect and post to the bus?

I found that there is an additional parameter in the connection string, that can change the StsEndpoint and I used it to use STS of the Service Bus, but I am receiving <Error><Code>404</Code><Detail>No service is hosted at the specified address...

The code I am using:

<?php

echo "Here we go...\n";

require_once 'vendor/autoload.php';

use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\ServiceBus\Models\BrokeredMessage;

echo "Create Service Bus REST proxy.\n";

$connectionString = 'Endpoint=sb://myhost.mydomain/myNamespace;StsEndpoint=https://myhost.mydomain:9355/myNamespace;SharedSecretIssuer=theSASName;SharedSecretValue=theSASKey';

$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);


try {
    echo "Create message. \n";
    $message = new BrokeredMessage();
    $message->setBody("my message");

    echo "Send message. \n";
    $serviceBusRestProxy->sendQueueMessage("my-queue", $message);
} catch(ServiceException $e) {
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code . ": " . $error_message .";\n";
}

echo "The End! \n";

?>
1
As far as I know, If we want to use Azure Service bus SDK, the endpoint format is like '[yourNamespace].servicebus.windows.net'. If you'd like to use REST API, please refer to this C# Code: stackoverflow.com/a/21754862/4836342Will Shao - MSFT
It's '[yourNamespace].servicebus.windows.net' when using Azure Service Bus. This is the on-prem version, I am asking for, and there it is the server host name used.Tsvetelin Pavlov

1 Answers

0
votes

@Tsvetelin,

According to official document about SDK, it is confirmed that Azure Service bus SDK 2.1 compatible with service bus 1.1. Please see the image below and the document(https://msdn.microsoft.com/en-us/library/dn441398.aspx). enter image description here

Another potential issue is that I recommend you can check whether your services were running using 'Get-SBFarmStatus'. Any update, please let me know.