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.

HTTP Connection in Iphone -


since i'm new in iphone need in learning http connections in iphone. please guide me tutorials learn http connections tricks in iphone , communicate websites.

also please guide me through sample code following problem: want send "hello world" text site , got reply web same word adiition of s i.e. "hello worlds".. please brothers guide me through sample code.. it's part of application i'm developing in iphone.

i new ,but have sent msg(soap xml) via http request .my sample code is...

// host address nsurl *url = [nsurl urlwithstring:@"http://xyz.com"]; nsmutableurlrequest *therequest =[nsmutableurlrequest requestwithurl:url];

// find msg length, here x msg nsstring *msglength = [nsstring stringwithformat:@"%d", [x length]];

// specify type of msg u have send host(mine xml) [therequest addvalue: @"text/xml; charset=utf-8" forhttpheaderfield:@"content-type"]; // name space optional 1 [therequest addvalue: @"http://mpack.h.org" forhttpheaderfield:@"soapaction"];

[therequest addvalue: msglength forhttpheaderfield:@"content-length"]; //type of http method [therequest sethttpmethod:@"post"]; // msg need send server [therequest sethttpbody: [soapmessage datausingencoding:nsutf8stringencoding]];

// establish connection host nsurlconnection *theconnection = [[nsurlconnection alloc] initwithrequest:therequest delegate:self];

if( theconnection ) { webdata = [[nsmutabledata data] retain]; nslog(@"connecting....");

} else { nslog(@"theconnection null");

}

}

// delegate method nsurlconnection -(void)connection:(nsurlconnection *)connection didreceiveresponse:(nsurlresponse *)response { [webdata setlength: 0]; } -(void)connection:(nsurlconnection *)connection didreceivedata:(nsdata *)data { [webdata appenddata:data]; } -(void)connection:(nsurlconnection *)connection didfailwitherror:(nserror *)error { nslog(@"error theconenction %@",error); [connection release]; [webdata release];

} // u ll response here -(void)connectiondidfinishloading:(nsurlconnection *)connection { nslog(@"done. received bytes: %d", [webdata length]);

}


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 -