2017-07-19 40 views
0

我能夠成功調用readStoredProcedure,但具有相同的鏈路,而不是爲deleteUserDefinedFunction ---我試圖鏈接的變化(_self,或生成所述URI以UriFactory.createStoredProcedureUri) ---再次,他們都與讀取和執行,但不是刪除。全錯誤信息是401錯誤刪除用戶定義的函數與documentdb客戶的NodeJS

The input authorization token can't serve the request. Please check that the expected payload is built as per the protocol, and check the key being used. Server used the following payload to sign:... 

我看着源代碼和兩個函數(讀取和刪除)似乎是以相同的方式使用路徑。

我知道這個問題DocumentDB - DELETE causes 401 error的,但它的文檔刪除問題,似乎並沒有解決問題,UDF我碰上

也許任何人都知道這是怎麼回事?

非常感謝!

這是我如何打電話只是供參考:

let sprocUri = documentdb.UriFactory.createStoredProcedureUri(DATABASEID,COLLECTIONID, name); 
console.log("sprcURI", sprocUri); 
client.readStoredProcedure(sprocUri, function(err, response) { 
    if (err) { 
     console.log("bad", JSON.stringify(err)); 
    } else { 
     console.log(`Succes for temporal queries: ${JSON.stringify(response)}`); 
     client.deleteUserDefinedFunction(sprocUri, ResponseLoggingWrapper("DELETE sproc " + name)); 
    } 
}); 

請注意,我已經更換了2次使用sprocUriresponse._self很好,但無濟於事。

另外請注意,我使用的存儲過程,但它主要是一樣的UDF的行爲明智

回答