Problems with library compiled from source code for SDK versions lower than 3.2

Aug 23, 2010 at 12:51 PM

We are developing an application that should be compatible with iPhone OS 3.0 and higher. The oData client library is compiled only for SDK 3.2 and 4.0, so I decided to compile it from the source code. I created a new static library project in XCode and included all folders that reside in the "framework/src/MSODataLib" folder. Then I generated a proxy class for our oData service and wrote the following code:

 

WindowsCredential *credential = [[WindowsCredential alloc] initWithUserName:@"login" password:@"password"];
		RsiDataSource *ds = [[RsiDataSource alloc] initWithUri:@"http://server/Rsi.svc/" credential:credential];
DataServiceQuery *query = [ds folders];
QueryOperationResponse *response = [query execute];

While this code is running on a device, a DataServiceQueryException is thrown in DataServiceQuery.m, line 309. While it is running in simulator, the situation is even worse - I get EXC_BAD_ACCESS message during execution of HTTP request (HTTPHandler.m, line 73).

Did anybody try to compile the library for lower versions of iPhone SDK? Are you experiencing similar problems and, if yes, how it is possible to solve them?

Aug 25, 2010 at 3:22 AM

I'll try to repro the problem but it might be caused by a different settings on the dev machine, is there a proxy between the dev machine and the OData service?

Initially we tested the code on earlier versions of the iOS (3.0) so there shouldn't be anything in the code that is not compatible with earlier version.

Thanks

Claudio

 

Aug 25, 2010 at 8:19 AM
Edited Aug 25, 2010 at 8:20 AM

claudioc, thanks for the response. We've found this problem reported on Apple developer forums: https://devforums.apple.com/message/109867#109867 . It occurs when a web server used HTTP Basic authentication. The problem was caused by a bug in SDK, which was fixed in version 3.2. Also it appears that I initialized the proxy class incorrectly - our server uses HTTP Basic authentication, but I passed an instance of WindowsCredential class. So, the problem is really not in the library code. Could you please give me a hint how to use Basic authentication with the library? By adding HTTP header in onBeforeSend callback?

Aug 25, 2010 at 6:17 PM
Edited Aug 25, 2010 at 6:19 PM

I'll post a sample on how to use basic auth shortly

Thanks

Claudio