Menu
  • HOME
  • TAGS

LimeSurvey RemoteControl2 API - Any add_response PHP examples?

php,jquery,xml-rpc,json-rpc,limesurvey

The $aResponseData must be the array of answer to set in table, looking at your example, to have the same 3 answer for Q1_1,Q1_2,q1_3, you can use $response_data = array( "527317X1X11" => "3", "527317X1X12" => "2", "527317X1X13" => "3", ); Just test with this first. You can use startdate to...

json-rpc parameters version 1.0 vs 2.0

json-rpc

You CAN have object parameters in 1.0, inside the array, so your first example is correct. The difference is that in 1.0 there must be an array in params (that can contain objects), and in 2.0 params itself can be an object. Correct in both 1.0 and 2.0: params: [{...

Angular JSON-RPC: processing error

javascript,json,angularjs,json-rpc

if you left the code as you had it originally, you can define a service which uses the jsonrpc module: angular.module('myApp'). service('jsonrpcservice', function(jsonrpc) { var service = jsonrpc.newService('svc'); this.get = service.createMethod('getData'); }); ..in your controller somewhere: jsonrpcservice.get({params}).success(function(result){}).error(function(err){}); you can handle the error in the .error() returned by $http...

XBMC GetInfoLabels command not working

json,json-rpc,xbmc

Ok, after a lot of research it seems I had to make an object of an array of labels. So this is the working solution http://192.168.5.34/jsonrpc?request={"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","params":{"labels": ["Network.IPAddress","Network.MacAddress"] },"id":1} As a result you get the IP and MAC from the XBMC system....

Drawing chart with Chart.js filled with data gotten per JsonRPC

javascript,jquery,callback,json-rpc,chart.js

The request is handled asynchronously, and thus you need to provide a callback, as you're already doing in the 'success', and 'error' blocks. Probably the easiest way is just to provide yet another callback to be called with the result, like so: $.jsonRPC.setup({ endPoint: '/jsonserver.php' }); getMyStuff(function (result) { console.log("here's...

JSON-RPC 2.0 allow Notifications to have an Error response?

json-rpc

Strictly no, there should be no JSON-RPC response. The Server MUST NOT reply to a Notification, including those that are within a batch request. Notifications are not confirmable by definition, since they do not have a Response object to be returned. As such, the Client would not be aware of...

My Windows Phone app Get empty response (404 Not Found) Scond time, work's great first time;And always work fine if without SSL

json,windows-phone-8,json-rpc

Please try to use this solution. public async Task<string> SendJSONData3(string urlToCall, string JSONData) { string UserName = "XXXXXXXXX"; string Password = "XXXXXXXXX"; var httpWebRequest = (HttpWebRequest)WebRequest.Create(urlToCall); httpWebRequest.Credentials = new NetworkCredential(UserName, Password); httpWebRequest.ContentType = "text/json"; httpWebRequest.Method = "POST"; using (var streamWriter = new StreamWriter(await httpWebRequest.GetRequestStreamAsync())) { string json = JSONData; streamWriter.Write(json);...

error while parsing an jsonarray

android,json,json-rpc

You have a typo for(int j=0; **i**<klArr.length(); j++)

Return a html page with first request to a Json Rpc Dispatcher server running locally at port 5000

perl,rpc,json-rpc,plack

According to the JSON-RPC 2.0 Specification: When a rpc call is made, the Server MUST reply with a Response, except for in the case of Notifications. The Response is expressed as a single JSON Object, ... So its not possible to get a html page from a JSON::RPC Server....

JSON RPC with Kodi (XBMC) to restart first item in playlist

c++,json,json-rpc,xbmc

Still not very happy with the fact that the json code provided by kodi is rather useless for the jsonrpc c++ library, but I managed to get it to work, the json file will need this line: {"jsonrpc": "2.0", "method": "Input.ExecuteAction", "params": { "action": "play"}, "id": 1} and then do:...

how to POST json data and response json in AFHTTPRequestOperationManager

objective-c,afnetworking,json-rpc

Thank you, this problem solved. Example code : NSMutableURLRequest *requestHTTP = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:my_url] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10]; [requestHTTP setHTTPMethod:@"POST"]; [requestHTTP setValue:AUTHORIZATION_VALUE forHTTPHeaderField:@"Authorization"]; [requestHTTP setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [requestHTTP setHTTPBody:[jsonString dataUsingEncoding:NSUTF8StringEncoding]]; AFHTTPRequestOperation *op =...

how to check if a JSONArray is empty in java?

arrays,json,json-rpc

If the array is defined in the file but is empty, like: ... "kl":[] ... Then getJSONArray("kl") will return an empty array, but the object is not null. Then, when you do: kl = c.getJSONArray("kl"); if(kl != null){ klassenID[i] = kl.getJSONObject(0).getString("id"); } kl is not null and kl.getJSONObject(0) will throw...

ZF2 JSON-RPC - Error response, data parameter, how to access?

zend-framework,zend-framework2,json-rpc

Turns out you have two choices to do this: 1) Add parameters to an exception: $e = new Exception('I pooped my pants'); $e->color = 'brown'; $->smell = 'bad'; color and smell would then be in the data parameter of the error response. 2) Pass the server (in my code, $jsonRpc)...

JSON-RPC for windows phone 8.1

windows,windows-8.1,json-rpc,windows-phone-8.1

In the end I used http://jsonrpc2.codeplex.com/ I had to make slight changes to the code, because some of the things weren't working, since it was made for windows phone 7 and not Windows Universal 8.1. However now it works great, without too much work. You can find the windows phone...

PHP Curl connection to JsonRPCServer Invalid Json

php,json,curl,json-rpc

You have to json encode the array first $post = json_encode($post); or CURLOPT_POSTFIELDS, json_encode($post) EDIT Try This: <?php $headers = array( 'Content-Type: application/json' ); $url="https://127.0.0.1:9999"; $post = array( "jsonrpc" => "2.0", "method" => "generateAddress", "id" => "1" ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);...

Populate a html div with json data received from a server

javascript,jquery,ajax,json,json-rpc

you need to append the key of the json item. $("#mybox").html(json.key); ...

Listening for changes in a MySQL Database that is accessed from a PHP web service

java,php,mysql,json-rpc

The simplest way would be to make a request to the PHP service with the time of your last read. Then you just query for any tuple (entity) with a last_update time greater than the last request time. This would require both applications to request for changes on an interval...

How to construct the CURL in JSON-RPC structure in PHP?

php,json,post,curl,json-rpc

The documentation of their API reference (the second link) states: For write requests, he data submitted to the media write API should be in JSON format, encoded as a form parameter named "json". The JSON document should include a "method" field and a "params" field, and the examples you publish...

Monaca Push Notification Backend Management API not working

ios,json,debugging,push-notification,json-rpc

The problem is solved. It seems that running curl commands in command prompt on windows has some problems which returns errors such as curl: (3) [globbing] unmatched brace in colum If you are facing the same problem, follow/recheck the following steps: Check whether you installed curl properly on Windows (http://guides.instructure.com/s/2204/m/4214/l/83393-how-do-i-install-and-use-curl-on-a-windows-machine)...

ZF2: Using JSON-RPC without MVC?

zend-framework2,json-rpc

Here is how I did it. I have this broken out into a few files, but you can put all this in your public root directory, something like rpc-service.php: use Zend\ServiceManager\ServiceManager, Zend\Mvc\Service\ServiceManagerConfig; class Bootstrap { /** @var ServiceManager */ private static $serviceManager; private static function _go() { chdir(dirname(__DIR__)); require __DIR__...

Kurento Media Server Throwing “ Unexpected error while processing method: Factory 'PlayerEndPoint'' not found”

json-rpc,kurento

You have several problems. The first is that PayerEndpoint is not correctly spelled (note the lower case "p" PlayerEnd-p-oint). The second is that you need firts to create a MediaPipeline before you can create a PlayerEndpoint or any other media element. If you are new to Kurento, my recommendation is...

Convert form elements to json and POST them to a server including some of them as a group of params

javascript,jquery,ajax,json,json-rpc

var username = "username"; var currentpass = "currentpass"; var newpass = "newpass"; var UserInfo = new Array(); UserInfo.push(username); UserInfo.push(currentpass); UserInfo.push(newpass); var data = new Object(); data["jsonrpc"] = "2.0"; data["method"] = "changepass"; data["id"] = "1"; data["params"] = UserInfo; console.log(JSON.stringify(data)); Try this where you submit your form data in ajax... If you...

JSONRPC with Grails

grails,web-applications,json-rpc

I would take a look at some existing JSON-based Grails plugins: https://grails.org/plugins/tag/json You might be able to take one of these and produce your own custom JSON output format - that is valid JSONRPC2. Otherwise, its a matter of simply creating a DTO object (simple Groovy bean with the structure...