bcusick
February 21, 2017, 4:07pm
1
Hey Guys,
Don’t know if any of you have seen this before…
I have a restful solution - and everything works great - EXCEPT - the first parameter to the ws_read is coming in as null - no matter what I do.
So - here’s the URL:
http://localhost:8080/servoy-service/rest_ws/prs_tracker_api/v1/studies/NCT02021175
Solution: prs_tracker_api
Form: v1
I was expecting to get the arguments:
[0]: "studies"
[1]: "NCT02021175"
What I got was:
[0]: ""
[1]: "NCT02021175"
So then I tried another URL with more parameters:
http://localhost:8080/servoy-service/rest_ws/prs_tracker_api/v1/repoorts/another/another2/another3/another4
and again I got everything back as expected - EXCEPT the first endpoint:
[0]: ""
[1]: "another"
[2]: "another2"
[3]: "another3"
[4]: "another4"
Any ideas are welcome!
SETTINGS:
Servoy 7.4.9
java.vm.name=Java HotSpot™ 64-Bit Server VM
java.version=1.8.0_121
java.vm.info=mixed mode
java.vm.vendor=Oracle Corporation
os.name=Windows 10
os.version=10.0
patrick
February 21, 2017, 4:32pm
2
I have just made a short test using solution “rest_ws”, form “v1” and issued this request
http://localhost:8080/servoy-service/rest_ws/rest_ws/v1/a/b/c/d/e/f
In the method I do
function ws_read() {
application.output(arguments[0]);
application.output(arguments[1]);
application.output(arguments[2]);
application.output(arguments[3]);
application.output(arguments[4]);
application.output(arguments[5]);
return 1;
}
and I get
a
b
c
d
e
f
Are you sure it was a get request you were issuing? A ws_create or ws_update method will receive your arguments from arguments[1] onwards, as they have the content of the request on arguments[0].
I am using Servoy 8.1.2 however, but I don’t think that has been touched in a while.
bcusick
February 21, 2017, 5:38pm
3
Hey Patrick,
Thank you very much for your quick reply!
It turns out it was a case of “stupid user detected”. I had named a local variable that overwrote the param.
Again - thank you for your time!