public function createHostedService($name, $label, CreateServiceOptions $options)
    {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');
        Validate::isString($label, 'label');
        Validate::notNullOrEmpty($label, 'label');
        Validate::notNullOrEmpty($options, 'options');

        // User have to set affinity group or location.
        $affinityGroup = $options->getAffinityGroup();
        $location = $options->getLocation();
        Validate::isTrue(
            !empty($location) || !empty($affinityGroup),
            Resources::INVALID_CREATE_SERVICE_OPTIONS_MSG
        );

        $hostedService = new HostedService();
        $hostedService->setName($name);
        $hostedService->setLabel($label);
        $hostedService->setLocation($options->getLocation());
        $hostedService->setAffinityGroup($options->getAffinityGroup());
        $hostedService->setDescription($options->getDescription());
        $hostedService->addSerializationProperty(
            XmlSerializer::ROOT_NAME,
            Resources::XTAG_CREATE_HOSTED_SERVICE
        );

        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_POST);
        $context->setPath($this->_getHostedServicePath());
        $context->addStatusCode(Resources::STATUS_CREATED);
        $context->setBody($hostedService->serialize($this->dataSerializer));
        $context->addHeader(
            Resources::CONTENT_TYPE,
            Resources::XML_CONTENT_TYPE
        );

        $this->sendHttpContext($context);
    }