我在Bluemix上为Watson Dialog服务创建了一个实例。我正在使用IBM Watson Dialog API reference中指定的基本身份验证通过Mobilefirst Adapter对Dialog API进行身份验证。我在Bluemix中提供服务实例的服务凭据中提供的用户名和密码。
当我调用适配器时,我得到了这个回复:
{
"code": 500,
"isSuccessful": true,
"message": "Forwarding error",
"responseHeaders": {
"Connection": "Keep-Alive",
"Content-Type": "application\/json",
"Date": "Tue, 12 Jul 2016 13:41:04 GMT",
"Server": "-",
"Set-Cookie": "Watson-DPAT=ZRbNg044CHnee09Pm0UOAKxqVbY4fZHXWj6%2Bb4mWeYkG56h873G%2F0A1jKTBH8zWK7NJjgYtkx1SaekClhk4CoZhad0PwuORRRdwkiXhAUh03uEnEqyDWh6n0WBIVxNWOoAAoxUMAqTDxfw%2BMHtwngXyZe47TZYk7IdsvsV%2F0bhLoAF6GS8YEwaamX7b7tfqchTfoQ3%2FIF7TbktyfJ9L8tUiQrwZyLlJcWv5Typn93J1km5Jl%2Fvc4K3W7zvtVygYeurP9Bb1slAp1PRGIppn97W%2F%2F3I%2FkKq3VS0VVo5BZXhvBf7SS%2FJg5mwQ8wbTyMqjIZXqF1zKuZ5FvlLJcYX%2BvFeJG28j429rDOvpIihOn%2FmMNV9eYeAubZQ929beB32dX90B1ChNwiYMFWe9cV7ONbaUCOLpzrO6rLKFtfeonRgsp0a6wdN3KLaBWJ9A4eB%2Fjffhfgro7N3iskxjCi5jkhgY0WOGdpg4kQmbq%2F%2F3b2a0GCP6hrYn%2BJL%2BfGNYg8wcb7xLmCRN77XwP8HqCeJ6TChi8YRpheO5CVjOlP0E5QOHAYWMTxDsLe4tV34FnPYSSvxVNY9f9sALsf627ymoOcG2r03tetgsR44f9MlkFGeydbfPtAVBZidVDLzajMqcigMf9J%2B92NXGXBVypFnu4gIkb5Uee0Duf8gRcMQSJ3M%2BhbFN4UzePYh4FLXfJv5EvQOm5AJewTtJcnrsxZfiXVDdVqNDpv3c3XWN%2F5Cenc7uKtlkFuwsnusJoBOvYQXLuMuJiDT9ODHwMn8vaM9qIZy9Mo4zReKDBnZXrlwTCphLEzhTCng6X24e46C29W8SgK97AhK4H3hY%3D; path=\/dialog\/api; secure; HttpOnly",
"Transfer-Encoding": "chunked",
"X-Backside-Transport": "FAIL FAIL",
"X-Client-IP": "195.212.29.160",
"X-DP-Watson-Tran-ID": "gateway-dp02-2901289c-0679-40df-bdc0-db2d7ccd8847",
"X-Error-Cause": "Zuul Error: COMMAND_EXCEPTION",
"X-Global-Transaction-ID": "10770268"
},
"responseTime": 1210,
"statusCode": 500,
"statusReason": "Internal Server Error",
"totalTime": 1372
}
此外,尝试使用以下命令行通过命令行对服务进行身份验证时
curl -u "username":"password" "https://gateway.watsonplatform.net/dialog/api/v1"
我收到回复:
{"code": 500, "message": "Forwarding error"}
该服务发生了什么?
其他Watson服务也发生在我身上:Languaje Translator。 (我还没有与其他人核实过)
答案 0 :(得分:0)
问题是https://gateway.watsonplatform.net/dialog/api/v1不是有效的端点。在这种情况下,Forwarding error
有点像404.
您可以使用Watson Dialog API specification查看哪些是有效的端点。
例如,要获取对话框列表,请对GET
执行/v1/dialogs
请求:
curl -u "username":"password" \
"https://gateway.watsonplatform.net/dialog/api/v1/dialogs"
输出类似于:
{
"dialogs": [
{
"name": "pizza_test_9",
"dialog_id": "94ce77db-1d15-4438-be6f-c96be8d883a6"
}
],
"language_packs": [
{
"name": "en-us-legacy",
"dialog_id": "en-us-legacy"
},
{
"name": "en-us",
"dialog_id": "en-us"
}
]
}
请务必使用您的服务凭据替换username
和password
。