Question

I've encountered a problem during development.

When the adapter is tested from within Eclipse ("Invoke Worklight procedure"), it does its job perfectly.

On the contrary, when the adapter is called from the app, it doesn't work. I receive the following error:

Error 405 HTTP method POST is not supported by this URL

I've noticed a strange thing. When the adapter is called from the test procedure the URL seems correct (/apps/services/api/...) In the other case, Worklight puts a worklight prefix (/worklight/apps/services/api/...) when it makes the call. Hence the URL cannot be reached.

Here Worklight Studio - error http 405 when connecting to mobile URL provided by Console I found a partial solution but it does not work.

Additional info

WL version is 5.0.6. Application server is Tomcat 7.

Was it helpful?

Solution

Based on my experiments I found the problem.

Each worklight project has an application-descriptor.xml. Within it there is a tag that indicates the WL server root URL.

Since I've taken the project from another source, I've simply noticed that it was configured as

<worklightServerRootURL>http://sampleDomain/worklight</worklightServerRootURL>

where sampleDomain is only a placeholder for the real one.

Now it is configured like

<worklightServerRootURL>http://${local.IPAddress}:8080</worklightServerRootURL>

to perform internal local tests.

Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top