public function getUrl($operationConfig, $operationMetadata, &$inputMap) {

        $queryParams = array();
        
        $action = $operationConfig->getAction();
        $resourcePath = $operationConfig->getResourcePath();
        $queryList = $operationConfig->getQueryParams();
        $resolvedHostUrl = $operationMetadata->getHost();

        //arizzini: we need to validate the host
        $this->validateHost($resolvedHostUrl);
        
        $url = "%s";
        
        //arizzini: we need to apply the environment variable.
        if (strpos($resourcePath, "#env") !== FALSE) {
            $environment = "";
            if (!empty($operationMetadata->getContext())) {
                 $environment = $operationMetadata->getContext();
            } 
            
            $resourcePath = str_replace("#env", $environment, $resourcePath);
            $resourcePath = str_replace("//", "/", $resourcePath);
        }
        
        $tmpUrl = Util::getReplacedPath($this->removeForwardSlashFromTail($resolvedHostUrl).$this->removeForwardSlashFromTail($resourcePath), $inputMap);
        array_push($queryParams, $tmpUrl);
        
        switch ($action) {
            case "read":
            case "delete":
            case "list":
            case "query":
                foreach ($inputMap as $key => $value) {
                    if(!is_array($value)) {
                        $url = $this->appendToQueryString($url, "%s=%s");
                        array_push($queryParams, Util::urlEncode(strval($key)));
                        array_push($queryParams, Util::urlEncode(strval($value)));
                    }
                }
                break;
            default:
                break;
        }
        
        // we need to remove any queryParameters specified in the inputMap and 
        // add them as quertParameters
        switch ($action) {
            case "create":
            case "update":
                $queryMap = Util::subMap($inputMap, $queryList);
                foreach ($queryMap as $key => $value) {
                    if(!is_array($value)) {
                        $url = $this->appendToQueryString($url, "%s=%s");
                        array_push($queryParams, Util::urlEncode(strval($key)));
                        array_push($queryParams, Util::urlEncode(strval($value)));
                    }
                }
                break;
            default:
                break;
        }

        if ($operationMetadata->isJsonNative() == false) {
            $url = $this->appendToQueryString($url, "Format=JSON");
        }
        $url = vsprintf($url, $queryParams);
        
        return $url;
    }