/** * updates the label and/or the description for a hosted service in Windows * Azure. * * @param string $name The name for the hosted service that is * unique within Windows Azure. * @param UpdateServiceOptions $options The optional parameters. * * @return none * * @see http://msdn.microsoft.com/en-us/library/windowsazure/gg441303.aspx */ public function updateHostedService($name, $options) { Validate::isString($name, 'name'); Validate::notNullOrEmpty($name, 'name'); Validate::notNullOrEmpty($options, 'options'); $label = $options->getLabel(); $description = $options->getDescription(); Validate::isTrue(!empty($label) || !empty($description), Resources::INVALID_UPDATE_SERVICE_OPTIONS_MSG); $hostedService = new HostedService(); $hostedService->setLabel($options->getLabel()); $hostedService->setDescription($options->getDescription()); $hostedService->addSerializationProperty(XmlSerializer::ROOT_NAME, Resources::XTAG_UPDATE_HOSTED_SERVICE); $context = new HttpCallContext(); $context->setMethod(Resources::HTTP_PUT); $context->setPath($this->_getHostedServicePath($name)); $context->addStatusCode(Resources::STATUS_OK); $context->setBody($hostedService->serialize($this->dataSerializer)); $context->addHeader(Resources::CONTENT_TYPE, Resources::XML_CONTENT_TYPE); $this->sendContext($context); }