Web Service URL parameters and the ? mark

Hi -

I’m having an issue with URL parameters using the rest_ws plugin.

It’s the same issue as described at this URL (which ironically implements the exact parameter structure i’m describing!) : viewtopic.php?f=34&t=12172, and there’s some discussion that this was fixed in a “later release of Servoy” - the topic was specifically about 3.5

I’m seeing the same issue in 5.2, where any characters after a ? mark in a parameter are ignored.

simplest web service method ever, on the form “base” in the solution “mobile”

function ws_read(resource){
		
	return resource
	
}

Results for a GET to the URL:
…/rest_ws/mobile/base/employees returns “employees”
…/rest_ws/mobile/base/employees?id=123 returns “employees” where it should return “employees?id=123” - so that I can split that string up and deal with the parameters.

Was this ever actually fixed? When JSON-P support was added to the plugin the callback parameter was added and that handles the question mark - is there a conflict there?

This seems to be the standard way of passing parameters in to a web service call, and would save me a massive amount of time if it actually worked?

Am I missing something or should I file a bug report?

Robwormald,

The rest_ws will place the additional parameters in a map that is an extra parameter to the ws_* methods.

…/rest_ws/mobile/base/employees?id=123&id=456&foo=bar will add a map argument to your

function ws_read(resource, argsmap){
   return resource+argsmap['id'][0]+'.'++argsmap['id'][1]+'.'+argsmap['foo'][0]   
}

returns employees.123.456.bar

Note that the argsmap contains an array of strings, also if the arg is used just once.

I see that this is currently not documented in https://wiki.servoy.com:8443/pages/rele … b+Services
I will add it there.

Rob

Brilliant, thanks. I figured they had to be ending up somewhere!

Follow up -

Rob, that method does not seem to work in Servoy 5.2.9. We tried a variety of different methods and none seem to capture the data after the ?

It does work in 6.0.2 though, and returns a nicely formatted object I can deal with.