无法通过API更新Tableau Workbook连接

时间:2018-11-10 20:01:18

标签: tableau tableau-server

我正在尝试通过Tableau REST API更新工作簿连接信息,但是收到错误400“缺少所需的XML值”。但是,我最终要发送的请求正文

<?xml version="1.0" encoding="UTF-8"?>
<tsRequest>
  <connection 
   embedPassword="True" password="password" 
   serverAddress="con.company.com" serverPort="5439" 
   userName="username"
  />
</tsRequest>

似乎与API documentation中描述的内容完全匹配:

<tsRequest>
  <connection
   serverAddress="server-address" serverPort="port"
   userName="connection-username" password="connection-password" 
   embedPassword="embed-password"  />
</tsRequest>

有人知道我在这里想念什么吗?

这是程序引发的异常:

  

TableauXMLResponseException“ TSRequest {_requestSiteId = Just(SiteID \” the-site-id \“),_requestMethod = PUT,_requestPath = \” / sites / the-site-id / workbooks-the-workbook-id / connections / the-connection-id \“,_ requestQueryParams = [],_ requestPayload =文档{documentPrologue =序言{prologueBefore = [],prologueDoctype = Nothing,prologueAfter = []},documentRoot =元素{elementName =名称{nameLocalName = \” tsRequest \ “,nameNamespace = Nothing,namePrefix = Nothing},elementAttributes = fromList [],elementNodes = [NodeElement(Element {elementName = Name {nameLocalName = \” connection \“,nameNamespace = Nothing,namePrefix = Nothing},elementAttributes = fromList [(名称{nameLocalName = \“ embedPassword \”,nameNamespace = Nothing,namePrefix = Nothing},\“ True \”),(Name {nameLocalName = \“ password \”,nameNamespace = Nothing,namePrefix = Nothing},\“ password \ “),(名称{nameLocalName = \” serverAddress \“,nameNamespace = Nothing,namePrefix = Nothing},\” con.company.com \“),(Name {na meLocalName = \“ serverPort \”,nameNamespace =否,namePrefix = Nothing},\“ 5439 \”),(名称{nameLocalName = \“ userName \”,nameNamespace = Nothing,namePrefix = Nothing},\“ username \”) ],elementNodes = []})]},documentEpilogue = []}}“”(响应{responseStatus =状态{statusCode = 400,statusMessage =“错误请求”},responseVersion = HTTP / 1.1,responseHeaders = [(” Date“ ,“星期五,2018年11月9日22:06:01 GMT”),(“ Content-Type”,“ application / xml; charset = utf-8”),(“ Transfer-Encoding”,“ chunked”),(“连接”,“保持活动”),(“服务器”,“ Tableau”),(“ X-Tableau”,“ Tableau Server”),(“ X-UA-Compatible”,“ IE = Edge”),( “ X-Content-Type-Options”,“ nosniff”),(“ X-XSS-Protection”,“ 1; mode = block“)],responseBody =” http://tableau.com/api \“ xmlns:xsi = \” http://www.w3.org/2001/XMLSchema-instance\“ xsi:schemaLocation = \” http://tableau.com/api http://tableau.com/api/ts-api-2.7.xsd\“ > Bad Request更新工作簿“ the-workbook-id”的连接“ the-connection-id”时出现问题。“,responseCookieJar = CJ {expose = []},responseClose'= ResponseClose})(MissingFieldException {mfeCallStack = [( “ missingFieldException”,SrcLoc {srcLocPackage =“ main”,srcLocModule =“ Network.Tableau.Required”,srcLocFile =“ src / Network / Tableau / Required.hs”,srcLocStartLine = 49,srcLocStartCol = 27,srcLocEndLine = 49,srcLocEndCol = 48}),(“必需”,SrcLoc {srcLocPackage =“ main”,srcLocModule =“ Network.Tableau.Types”,srcLocFile =“ src / Network / Tableau / Types.hs”,srcLocStartLine = 476,srcLocStartCol = 46,srcLocEndLine = 476,srcLocEndCol = 54}),(“ parseTSResponse”,SrcLoc {srcLocPackage =“ main”,srcLocModule =“ Network.Tableau.Types”,srcLocFile =“ src / Network / Tableau / Types.hs”,srcLocStartLine = 196, srcLocStartCol = 23,srcLocEndLine = 196,srcLocEndCol = 44}),(“ parseHT TPServerResponse“,SrcLoc {srcLocPackage =” main“,srcLocModule =” Network.Tableau.Client“,srcLocFile =” src / Network / Tableau / Client.hs“,srcLocStartLine = 123,srcLocStartCol = 8,srcLocEndLine = 123,srcLocEndCol = 39 })],mfeMessage =“缺少所需的XML值”})

0 个答案:

没有答案