Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

How to get data from a json-rpc webservice : iPad /iPhone / Objective C -


i'am working on ipad project , project needs talk json-rpc webservices. webservices based on drupal module : cck , views

1)i need push json object webservice 2)i need callback data webservice

i have implemented sbjson api , https://github.com/samuraisam/deferredkit/ api ipad project.

the sbjson api works fine , understand 1 samuriaisam defferedkit new me

my question how data out of json-rpc webservice, has sample code? or places can find objective c - json-rpc webservice documentation.

kind regards,

bart schoon

---------update--------

i use code now:

nsstring *jsonstring = @"{\"method\":\"views.get\",\"params\":{\"view_name\":\"client_list\",\"sessid\":\"xxxxxx\"},\"id\":1}";     nsstring *requeststring = [nsstring stringwithformat:@"%@",jsonstring,nil];      nslog(@"input: %@",jsonstring);      nsdata *requestdata = [nsdata datawithbytes: [jsonstring utf8string] length: [jsonstring length]];      nsmutableurlrequest *request = [[nsmutableurlrequest alloc] initwithurl: [nsurl urlwithstring:@"http://subdomain.domain.com/services/json-rpc"]];      nsstring *postlength = [nsstring stringwithformat:@"%d", [requestdata length]];     [request sethttpmethod: @"post"];     [request setvalue:@"content-type: application/json" forhttpheaderfield:@"content-type"];     [request sethttpbody:requestdata];      //data returned webservice     nsdata *returndata = [nsurlconnection sendsynchronousrequest: request returningresponse: nil error: nil ];     nsstring *returnstring = [[nsstring alloc] initwithdata:returndata encoding: nsutf8stringencoding];     nslog(@"output: %@",returnstring); 

this result in message server:

{"error":{"name":"jsonrpcerror","code":-32600,"message":"the received json not valid json-rpc request"},"version":"1.1"} 

---------/update--------

what wrong? has experience this?

kind regards,

bart schoon

read json file data.

nsdictionary *dictionary = [jsonstring jsonvalue]; key & value pair. store data in respective variable.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -