cancel
Showing results for 
Search instead for 
Did you mean: 

ESP project enabled as web service: Invalid Connection Detail

0 Kudos

Hello Colleagues,

I am just starting with ESP. I tried the example on the help protal (Example: Sending a JSON Request Using a REST Web Service Client - Adapters Guide - SAP Library), which is only to create a project with an input window, enable the project to be web-service, start the service, and then send a POST request to push one row into the table.

Service is started: http://localhost:9090/espws/services/ESPWebService?wsdl

But retrieving metadata from or sending JSON request to the web service both failed with '400 Invalid Connection Detail' error.

This is the POST request header I send to get metadata:

http://localhost:9091/espws/restservice/stream/window1?action=get&workspace=default&project=rest_jso...

And the request body:

{

    "connectionDetails": {

        "clusterName": "localhost",

        "port": "19011",

        "authentication": {

            "type": "user",

            "data": "username:password",

            "sslEnabled": "true"

        }

    }

}

I have been struggling with this for a couple of days now. Did I use the correct credentials, what "username/password" shall be used? Could you please help me to make this work?

Thanks a lot for your help.

Best regards,

Tao

Accepted Solutions (1)

Accepted Solutions (1)

RobertWaywell
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you are trying to retrieve the metadata for the project then you need to use a GET instead of a POST:

View the Metadata of a Project - Adapters Guide - SAP Library

That contrasts with inserting an event to a stream where you would use a POST method.

To make it a little simpler to test the initial connection, I would suggest just trying to get a list of the workspaces in the project:

View a List of Workspaces in a Cluster - Adapters Guide - SAP Library

Make sure you use the Base64 encoded version of your own user name and password.

0 Kudos

Hello Robert,

thanks a lot for spending time analyzing the problem with me. I finally got it working. Just like you suggested, I changed the port in connectionDetails to '9786', and user data un-encoded.

Although, it is still confusing to me what port number to be used in the connectionDetails. And, isn`t it unsafe to send credentials un-encoded?

Anyway, I am happy to have a running web-service, however simple it is.

Thanks again,

Tao

RobertWaywell
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Tao,

Yes you should definitely encode the credentials in a production environment. Starting with the unencoded credentials makes the initial configuration and testing easier while working in your development environment.

Note that ESP and Smart Data Streaming both support granular user permissions. For example you can create a user that only has permissions to insert events to a single stream. Take a look at the Cluster Administration Tool as the starting point for understanding user permissions:

Cluster Administrative Tool - SAP Event Stream Processor: Configuration and Administration Guide - S...

0 Kudos

Thanks, very helpful!

Tao

Answers (0)