Permalink
Browse files

Merge pull request #6 from Gwennin/master

Custom Headers & Small Corrections
  • Loading branch information...
2 parents 3429b41 + c7a333c commit febe5f6ba490aed74a1dab00f7f970e4418afef9 @arlobelshee arlobelshee committed May 31, 2012
View
BIN .DS_Store
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
@@ -31,7 +31,6 @@
}
-@property(nonatomic,retain, getter=getEtag, setter=setEtag: )NSString *m_OData_etag;
@property(nonatomic,retain, getter=getObjectID, setter=setObjectID: )NSString *m_OData_obectID;
@@ -48,7 +48,7 @@ - (id) initWithHttpResponse:(HttpResponse*)aHttpResponse
}
else
{
- m_headers = [[NSMutableArray alloc] init];
+ m_headers = [[NSMutableDictionary alloc] init];
}
}
@@ -46,6 +46,7 @@ @implementation ObjectContext
@synthesize m_Credential;
@synthesize m_entities;
@synthesize m_timeOutInterval;
+@synthesize m_entityFKRelation;
+ (void)initialize
{
@@ -610,7 +611,12 @@ -(HTTPHandler*) executeHTTPRequest:(NSString *)aUri httpmethod:(NSString *)metho
else
httpdata = [[NSData alloc] initWithData:[body dataUsingEncoding:NSUTF8StringEncoding]];
- HTTPHandler * httpHandler = [self executeHTTPRequest:aUri httpmethod:method httpbodydata:httpdata etag:etag customHeaders:nil];
+ HTTPHandler * httpHandler = nil;
+ if ([m_customHeaders count] != 0)
+ httpHandler = [self executeHTTPRequest:aUri httpmethod:method httpbodydata:httpdata etag:etag customHeaders:m_customHeaders];
+ else
+ httpHandler = [self executeHTTPRequest:aUri httpmethod:method httpbodydata:httpdata etag:etag customHeaders:nil];
+
[httpdata release];
return httpHandler;
}
@@ -1553,7 +1559,7 @@ - (void) attachLocation:(ODataObject*)anODataObject location:(NSString*)aLocatio
-(void) setEntitiesWithArray:(NSArray *)anArray
{
- [self setEntities:[[[NSArray alloc]initWithArray:anArray] autorelease] ];
+ [self setEntities:[[[NSMutableArray alloc]initWithArray:anArray] autorelease] ];
}
@@ -298,7 +298,7 @@ - (void) performBatchRequest
{
NSString *uri =[m_context getBaseUriWithSlash];
uri = [uri stringByAppendingString:@"$batch"];
- HttpBatchRequest *request = [[HttpBatchRequest alloc] initWithUri:uri batchBoundary:m_batchBoundary batchRequestBody:m_batchRequestBody credentials:nil batchHeaders:nil credentialsInHeaders:NO context:m_context];
+ HttpBatchRequest *request = [[HttpBatchRequest alloc] initWithUri:uri batchBoundary:m_batchBoundary batchRequestBody:m_batchRequestBody credentials:nil batchHeaders:m_context.m_customHeaders credentialsInHeaders:NO context:m_context];
HttpBatchResponse *response = [request GetResponse];
[self setHttpResponsesArray:[response getHttpResponses]];
[self storeBatchResponse];

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "D2AAC07D0554694100DB518D"
+ BuildableName = "libMSODataLib.a"
+ BlueprintName = "MSODataLib"
+ ReferencedContainer = "container:MSODataLib.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>MSODataLib.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>D2AAC07D0554694100DB518D</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
@@ -43,7 +43,7 @@ -(id)initWithUri:(NSString *)uri batchBoundary:(NSString *)batchBounds batchRequ
{
NSString *batchBoundary = [NSString stringWithFormat:@"multipart/mixed; boundary=%@",batchBounds];
NSData *postBody = [NSData dataWithData:[body dataUsingEncoding:NSUTF8StringEncoding]];
- NSMutableDictionary *requestHeaders = [NSDictionary dictionaryWithObjectsAndKeys:
+ NSMutableDictionary *requestHeaders = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"application/atom+xml,application/xml", @"Accept",
batchBoundary, @"Content-Type",
@"1.0",@"DataServiceVersion", nil];

0 comments on commit febe5f6

Please sign in to comment.