2016-11-07 59 views
0

我正在嘗試開發一種alexa技能,這與我自己的webservice(tomcat)進行通信。爲了建立我跟隨亞馬遜指南(https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/deploying-a-sample-skill-as-a-web-service)的項目。無法調用遠程端點alexa

現在我仍然無法連接到web服務,只能得到消息「無法調用遠程端點,或者它返回的響應無效」。

該服務託管在https://ec2-54-159-167-123.compute-1.amazonaws.com/PiaServer上,並可通過https訪問。我使用了自簽名證書。我按照文檔中所述完成了所有操作,但仍無法連接。根本沒有tomcat日誌。

我的終端是來自amazon java-skill-kit的speechletServlet。

當我通過郵差(鉻附加組件),我得到一個完美的JSON-響應請求(見下文):

{ "version": "1.0", "response": { "outputSpeech": {"type":"PlainText", "text": "text" }, "card": { "type": "Simple", "title":`enter code here`"Tank", "content": "text" }, "shouldEndSession": true } } 

你有任何想法如何解決這個問題?

編輯:我在亞馬遜EC2上託管服務。

回答

3

今天我有同樣的問題,但有效的讓我們的加密證書:

遠程端點無法調用,或者返回的響應無效。

Alexa Service Simulator with "The remote endpoint could not be called, or the response it returned was invalid" as the service response

在我的情況的原因「遠程端點不能被稱爲」錯誤是SSL證書配置。

由於我有效的讓我們爲我的端點加密證書,我假設我必須選擇My development endpoint has a certificate from a trusted certificate authority選項。

但是沒有工作。該請求甚至沒有到達網絡服務器。

Alexa SSL Certificate configuration that leads to an "remote endpoint could not be called" error

當您選擇My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority相反,它會奏效。

Working Alexa Skill SSL Configuration

我用Runscope作爲透明代理調試我Alexa的端點。如果你更改了SSL配置爲「我的發展終點是具有通配符證書域的子域」,你可以看到在交通檢查的要求:

Alexa request in the Runscope traffic inspector

但是我有沒有解釋爲什麼第一個選項不起作用,第二個選項不起作用。

起初我懷疑是和SNI有關,但事實並非如此。我檢查了兩個選項發送的數據包,並且在兩種情況下,Amazon都會在SSL Client Hello中發送server_name

0

我也遇到了同樣的問題。我能夠通過修改插槽值來解決。 例如請求中的插槽部分如下給出,

"slots": {"<intent-slot-name>": { 
     "name": "<intent-slot-name>", 
     "value": "<value>" 
    }}