PDA

View Full Version : executing a service for a data store



dgrtmufasa
2 Sep 2011, 7:19 AM
Hello all,

I am a newbie in the mobile development area :)

I have a service that was generated by Wavemaker. To post a query to the service (and get data back successfully), one would execute this:

http://kaseypc:8092/Payments/runtimeService.json

with the following inputs (I saw this under the "Post" tab of firebug):

{"params":["KDM","com.kdm.data.Custbillers",null,{"properties":[],"filters":
[],"matchMode":"start","ignoreCase":false},
{"maxResults":500,"firstResult":0}],"method":"read","id":1}
I then tried to make changes so that it would work with the client side (javascript)

$(function(){
$.ajax({
type: "POST",
url: "http://kaseypc:8092/Payments/runtimeService.json",
params: KDM,com.kdm.data.Custbillers,null,{properties:[],filters:[],matchMode:start,ignoreCase:false},{maxResults:500,firstResult:0},
method: read,
id: 1,
dataType: 'jsonp',
success: function( ) { }
});
})

but got an error. My suspicion is that I did not translate the input I saw in Firebug properly so that it could be recognized on the javascript side.

Can someone tell me how I can format this so I can get a result data set from the service?

TIA

skirtle
3 Sep 2011, 2:37 PM
This forum is for ExtJS 4. By the looks of it you aren't using ExtJS, looks like jQuery.

Suggest you track down an IDE that can do syntax checking on your code. The params option is followed by a load of invalid JavaScript.