Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4273770
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:45:27+00:00 2026-05-21T07:45:27+00:00

I have a web-service running on Windows Azure which returns JSON that I consume

  • 0

I have a web-service running on Windows Azure which returns JSON that I consume in my iPhone app.

Unfortunately, Windows Azure doesn’t seem to support the compression of dynamic responses yet (long story) so I decided to get around it by returning an uncompressed JSON package, which contains a compressed (using GZIP) string.

e.g

{"Error":null,"IsCompressed":true,"Success":true,"Value":"vWsAAB+LCAAAAAAAB..etc.."}

… where value is the compressed string of a complex object represented in JSON.

This was really easy to implement on the server, but for the life of me I can’t figure out how to decompress a gzipped NSString into an uncompressed NSString, all the examples I can find for zlib etc are dealing with files etc.

Can anyone give me any clues on how to do this? (I’d also be happy for a solution that used deflate as I could change the server-side implementation to use deflate too).

Thanks!!

Steven

Edit 1: Aaah, I see that ASIHTTPRequest is using the following function in it’s source code:

//uncompress gzipped data with zlib
+ (NSData *)uncompressZippedData:(NSData*)compressedData;

… and I’m aware that I can convert NSString to NSData, so I’ll see if this leads me anywhere!

Edit 2: Unfortunately, the method described in Edit 1 didn’t lead me anywhere.

Edit 3: Following the advice below regarding base64 encoding/decoding, I came up with the following code. The encodedGzippedString is as you can guess, a string “Hello, my name is Steven Elliott” which is gzipped and then converted to a base64 string. Unfortunately, the result that prints using NSLog is just blank.

NSString *encodedGzippedString = @"GgAAAB+LCAAAAAAABADtvQdgHEmWJSYvbcp7f0r1StfgdKEIgGATJNiQQBDswYjN5pLsHWlHIymrKoHKZVZlXWYWQMztnbz33nvvvffee++997o7nU4n99//P1xmZAFs9s5K2smeIYCqyB8/fnwfPyK+uE6X2SJPiyZ93eaX+TI9Lcuiatvx/wOwYc0HGgAAAA==";
NSData *decodedGzippedData = [NSData dataFromBase64String:encodedGzippedString];
NSData* unGzippedJsonData = [ASIHTTPRequest uncompressZippedData:decodedGzippedData];   
NSString* unGzippedJsonString = [[NSString alloc] initWithData:unGzippedJsonData encoding:NSASCIIStringEncoding];       
NSLog(@"Result: %@", unGzippedJsonString);  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:45:28+00:00Added an answer on May 21, 2026 at 7:45 am

    After all this time, I finally found a solution to this problem!

    None of the answers above helped me, as promising as they all looked. In the end, I was able to compress the string on the server with gzip using the chilkat framework for .net … and then decompress it on the iphone using the chilkat framework for iOS (not yet released, but available if you email the guy directly).

    The chilkat framework made this super easy to do so big thumbs up to the developer!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web service that is running on IIS (6 or 7, doesn't
I have a WCF service that's deployed as a Windows Azure Web Role. I'm
I am running windows vista business 64 bit. I have a web service that
I have a .NET Web Service running in VS2005 and a client that consumes
I have an ASP.NET web service running that accepts both HTTP POST and SOAP
I have a static dictionary which holds authentications for a web service. I'm running
I have a WSE 3.0 based web service running in Windows Server 2003 under
I have a web service running in IIS 6.0 on Windows 2003. It's authentication
I am running on Windows 7/IIS 7.5, and have a web service set up
I have a WCF web service that I am hosting in IIS (actually running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.