0
votes

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":[]}

1
any reason you cant escape the uri before calling the prodedure - tik27
tried encoding the URI with encodeURIComponent function before I pass it to the procedure and it worked. Thank you. - nkumar

1 Answers

1
votes

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]