ios - convert Stream object to an ArrayList C# -
let me explain whole scenario first. code on ios side.
nsmutablearray * myarr= [[nsmutablearray alloc]init]; nsstring *str1=@"hello"; nsstring *str2=@"waleed"; nsstring *str3=@"whatsup"; nsdata *mydata=[str1 datausingencoding:nsutf8stringencoding]; nsdata *mydata2=[str2 datausingencoding:nsutf8stringencoding]; nsdata *mydata3=[str3 datausingencoding:nsutf8stringencoding]; [myarr addobject:mydata]; [myarr addobject:mydata2]; [myarr addobject:mydata3]; nsdata *bigdata = [nskeyedarchiver archiveddatawithrootobject:myarr]; nsstring *urlstring = @"http://192.168.249.1/service/getemployees.svc/arrayupload/"; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; [request seturl:[nsurl urlwithstring:urlstring]]; [request sethttpmethod:@"post"]; nsmutabledata *postbody = [nsmutabledata data]; //add image data post [postbody appenddata:[nsdata datawithdata:bigdata]]; [request sethttpbody: postbody]; // connect web nsdata *respdata = [nsurlconnection sendsynchronousrequest:request returningresponse:nil error:nil]; nsstring *respstr = [[nsstring alloc] initwithdata:respdata encoding:nsutf8stringencoding];
this code takes 3 different strings, converts of them in nsdata, put nsdata objects them them in mutablearray , converts mutablearray nsdata in order post through wcf web sevice.
now on c# have funtion in nsdata (converted nsmutablearray) received in stream object
public string arrayupload(stream stream) { //code here }
now stream object have nsdata of array. want extract array , strings 1 one. can please?
Comments
Post a Comment