Url_InitiateFileUpload() public method

The URL to start na upload
public Url_InitiateFileUpload ( TableauServerSignIn, logInInfo ) : string
logInInfo TableauServerSignIn,
return string
Ejemplo n.º 1
0
    /// <summary>
    /// Get an upload sessiosn Id
    /// </summary>
    /// <returns></returns>
    private string RequestUploadSessionId()
    {
        var urlInitiateFileUpload = _onlineUrls.Url_InitiateFileUpload(_onlineSession);

        var webRequest = this.CreateLoggedInWebRequest(urlInitiateFileUpload, "POST"); //NOTE: This command requires a POST not a GET
        var xmlDoc     = GetWebReponseLogErrors_AsXmlDoc(webRequest, "get datasources list");

        //Get all the workbook nodes
        var nsManager  = XmlHelper.CreateTableauXmlNamespaceManager("iwsOnline");
        var uploadInfo = xmlDoc.SelectSingleNode("//iwsOnline:fileUpload", nsManager);
        var sessionId  = uploadInfo.Attributes["uploadSessionId"].Value;

        AppDiagnostics.Assert(!string.IsNullOrWhiteSpace(sessionId), "Empty upload session id?");
        return(sessionId);
    }