2017-07-19 43 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的行为明智

回答