src/ServiceBus/ServiceBusRestProxy.php
public function sendMessage($path, BrokeredMessage $brokeredMessage)
    {
        $httpCallContext = new HttpCallContext();
        $httpCallContext->setMethod(Resources::HTTP_POST);
        $httpCallContext->addStatusCode(Resources::STATUS_CREATED);
        $httpCallContext->setPath($path);
        $contentType = $brokeredMessage->getContentType();

        if (!is_null($contentType)) {
            $httpCallContext->addHeader(
                Resources::CONTENT_TYPE,
                $contentType
            );
        }

        $brokerProperties = $brokeredMessage->getBrokerProperties();
        if (!is_null($brokerProperties)) {
            $httpCallContext->addHeader(
                Resources::BROKER_PROPERTIES,
                $brokerProperties->toString()
            );
        }
        $customProperties = $brokeredMessage->getProperties();

        if (!empty($customProperties)) {
            foreach ($customProperties as $key => $value) {
                $value = json_encode($value);
                $httpCallContext->addHeader($key, $value);
            }
        }

        $httpCallContext->setBody($brokeredMessage->getBody());
        $this->sendHttpContext($httpCallContext);
    }
public function sendMessage($path, BrokeredMessage $brokeredMessage)
    {
        $httpCallContext = new HttpCallContext();
        $httpCallContext->setMethod(Resources::HTTP_POST);
        $httpCallContext->addStatusCode(Resources::STATUS_CREATED);
        $httpCallContext->setPath($path);
        $contentType = $brokeredMessage->getContentType();

        if (!is_null($contentType)) {
            $httpCallContext->addHeader(
                Resources::CONTENT_TYPE,
                $contentType
            );
        }

        $brokerProperties = $brokeredMessage->getBrokerProperties();
        if (!is_null($brokerProperties)) {
            $httpCallContext->addHeader(
                Resources::BROKER_PROPERTIES,
                $brokerProperties->toString()
            );
        }
        $customProperties = $brokeredMessage->getProperties();

        if (!empty($customProperties)) {
            foreach ($customProperties as $key => $value) {
                $value = json_encode($value);
                $httpCallContext->addHeader($key, $value);
            }
        }

        $httpCallContext->setBody($brokeredMessage->getBody());
        $this->sendHttpContext($httpCallContext);
    }
public function sendMessage ( $ path , BrokeredMessage $ brokeredMessage ) { $ httpCallContext = new HttpCallContext ( ) ; $ httpCallContext -> setMethod ( Resources :: HTTP_POST ) ; $ httpCallContext -> addStatusCode ( Resources :: STATUS_CREATED ) ; $ httpCallContext -> setPath ( $ path ) ; $ contentType = $ brokeredMessage -> getContentType ( ) ; if ( ! is_null ( $ contentType ) ) { $ httpCallContext -> addHeader ( Resources :: CONTENT_TYPE , $ contentType ) ; } $ brokerProperties = $ brokeredMessage -> getBrokerProperties ( ) ; if ( ! is_null ( $ brokerProperties ) ) { $ httpCallContext -> addHeader ( Resources :: BROKER_PROPERTIES , $ brokerProperties -> toString ( ) ) ; } $ customProperties = $ brokeredMessage -> getProperties ( ) ; if ( ! empty ( $ customProperties ) ) { foreach ( $ customProperties as $ key => $ value ) { $ value = json_encode ( $ value ) ; $ httpCallContext -> addHeader ( $ key , $ value ) ; } } $ httpCallContext -> setBody ( $ brokeredMessage -> getBody ( ) ) ; $ this -> sendHttpContext ( $ httpCallContext ) ; }
Sends a brokered message.

Queues:

@link http://msdn.microsoft.com/en-us/library/windowsazure/hh780775

Topic Subscriptions:
@link http://msdn.microsoft.com/en-us/library/windowsazure/hh780786

@param string          $path            The path to send message
@param BrokeredMessage $brokeredMessage The brokered message
Sends a brokered message .