Uploading XML with NSInputStream


hi,
have upload xml string server & web service expect in body stream part of http request. allocating nsinputstream instance xml data & setting part of http string uploading stream body null & in code if check stream status, gives error & size null, let me know how done , pasting code.

code:
nsinputstream* stream = [[[nsinputstream alloc]initwithdata:streamdata]retain]; 	 	 request=[nsmutableurlrequest requestwithurl:[nsurl urlwithstring:nss_url]]; nsstring *msglength = [nsstring stringwithformat:@"%d", [message length]]; [request addvalue: @"text/xml; charset=utf-8" forhttpheaderfield:@"content-type"]; [request addvalue: @"http://www.xyz.com/acl" forhttpheaderfield:@"soapaction"];     [request addvalue: msglength forhttpheaderfield:@"content-length"]; 	[request sethttpbodystream:[nsinputstream inputstreamwithdata:streamdata]]; 	[request sethttpmethod:@"post"];  	nslog(@"the input stream %@ & error %@",[stream streamstatus],[stream streamerror]);
its gives: input stream is (null) & error error domain=nsunknownerrordomain code=0 "operation not completed. (nsunknownerrordomain error 0.)"


inputs missing ..........
 



Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments