Mismatch when passing a parameter to a DSS REST Webservice

ralf.tschammer.googlemail.com's picture
Hi, I tried to pass a parameter from within a JS-Framework to DSS 2.5.0. Use Case: when pressing a button, a product with the specific "productCode=RTS_003" is to be be deleted. In the framework the parameter is generated as : /serviceURL/resource_path/?productCode=RTS_003 DSS throws an exception: ... Default Namespace: http://ws.wso2.org/dataservice Current Request Name: _deleteproductrem_productcode Current Params: {productCode={productCode,RTS_003}} Nested Exception:- Scalar type expected Current Params: {productCode={,RTS_003}} Field Name: productCode Field Value: {,RTS_003} ... Instead of "RTS_003" the parameter value is interpreted as {,RTS_003}. Here a piece of the DSS Data Service definition file: delete Products where productCode=? What is my error ? Does'nt DSS understand the Parameter notation: /serviceURL/resource_path[/?parameter1=parameter_value1[&parameter2=parameter_value2][&...]] and must have ?: /serviceURL/resource_path[/parameter_value1[/parameter_value2][/...]] Regards -------------------- Because my "piece of the DSS Data Service definition file:" (see above) has been "swallowed" by the Drupal-CMS I have attached the whole DSS-Definition as a file. Regards
AttachmentSize
ResourcesSampleRTS.txt4.99 KB
kalpanie's picture

Check the parameter notations

Hi, Could you pls check this, by passing the parameters as follows. Eg: /serviceURL/resource_path/parameter_value1/parameter_value2 You don't need to use '?' mark. Since you have mentioned the parameter order in the data service, when you creating the resource (), you just have to pass the parameter values by separating them by the slashes. (parametervalue1/parameterValue2). Thanks. Kalpanie
manfred.herrmann.z.web.de's picture

URI-template syntax ... tryit bug

@Kalpanie Ralf talks about a "javascript-framework". This requires the not so RESTful URL-parameter syntax. What I tried with configuring dataservices, it is possible to define resources with "?parameter=value". And of course the ideal RESTful "resource-path syntax" is working too. The "?" is a URI-template pattern and this is supported by WSO2-DSS, right? I defined resources with "?parameter=value"-syntax. The http-methods (get/put/post/delete) are doing o.k. but the tryit-client is broken. best regards manfred
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
KeellsSuper is a leading supermarket chain with 50-plus outlets in Sri Lanka, and it offers the only online supermarket in the country. In 2005, JKH implemented SAP ERP across it’s 70 subsidiaries...
Thursday, February 16th 2012, 09.00 AM (PST)

Thursday, February 16th 2012, 10.00 AM (GMT)