nkumar
nkumar

Reputation: 1

How to pass URI as parameter into worklight adapters

I am looking to pass the URI as parameter to a worklight adapter that converts the JSON to a SOAP request. Unfortunately I could not pass the URI since it has some chunks of data. Is there another way I can pass the long string with special characters as parameter to an adapter?

URL to hit the adapter: https://hostname:port/worklight/invoke?adapter=adaptername&procedure=procdurename&parameters=["URI with special characters"]

Error Output:

{"errors":["I O: String not terminated on line 1, column 15"],"isSuccessful":false,"warnings":[],"info":[]}

Upvotes: 0

Views: 133

Answers (1)

Sami
Sami

Reputation: 564

in worklight.properties add the the URI like

URI=URI-Value

Example:

LOGINHELPCONTENTURLEN = /wps/wcm/connect/GRS-EnglishLibrary/......

In your Adapter JS:

var uri = WL.Server.configuration["URI"];

In your invocation:

https://hostname:port/worklight/invoke?adapter=adaptername&procedure=procdurename&parameters=[uri]

Upvotes: 1

Related Questions