1

I'm trying to develop an alexa skill, whichs communicates with my own webservice (tomcat). To set up the project i followed the amazon guides (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/deploying-a-sample-skill-as-a-web-service).

Now I still can't connect to the webservice and only get the message "The remote endpoint could not be called, or the response it returned was invalid".

The Service is hosted on https://ec2-54-159-167-123.compute-1.amazonaws.com/PiaServer and is reachable with https. I used a self-signed certificate. I did everything as described in the documentation, but still can't connect. There are no tomcat logs at all.

My endpoint is a speechletServlet from amazon java-skill-kit.

When I do the request via Postman (Chrome Addon), I get a perfect JSON-Response (see below):

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

Do you have any Ideas how to solve this?

EDIT: I hosted the service on Amazon EC2.

cab91
  • 33
  • 1
  • 5

2 Answers2

4

I had the same issue today, but with valid Let's encrypt certificate:

The remote endpoint could not be called, or the response it returned was invalid.

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

In my case the reason for the "remote endpoint could not be called" error is the SSL Certificate configuration.

Since I have valid Let's Encrypt certificate for my endpoint I assumed I have to choose the My development endpoint has a certificate from a trusted certificate authority option.

But that did not work. The request did not even reach the web-server.

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

When you choose My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority instead it will work.

Working Alexa Skill SSL Configuration

I used Runscope as a transparent proxy to debug my Alexa endpoint. And if you change the SSL configuration to "My development endpoint is a sub-domain of a domain that has a wildcard certificate" you can see the request in the traffic inspector:

Alexa request in the Runscope traffic inspector

But I have no explanation why the first option does not work and the second does.

At first I suspected that is has do with SNI, but that is not the case. I checked the packets being sent for both options and in both cases Amazon sends the server_name in the SSL Client Hello.

Andreas Koch
  • 1,977
  • 1
  • 13
  • 8
0

I had also faced the same issue. I was able to solve by modifying the slot values. For example slot part in the request is given as below,

   "slots": {"<intent-slot-name>": {
      "name": "<intent-slot-name>",
      "value": "<value>"
    }}
jrh
  • 764
  • 13
  • 31