Q:

Can we get Preapproval key by sending request to PayPal server from iPhone? ( For testing)

I am just trying to fetch the Preapproval Key from PayPal server right from my iPhone App instead of setting up a Separate server for that. ( For Testing Purpose).  Can this be achieved? 
I have used the following code to do that:
NSString *url = @"requestEnvelope.errorLanguage=en_US&cancelUrl=http://www.bytelyte.com/PayPal_X_NVP_tester.php?cmd=test&currencyCode=USD&endingDate=27.05.11 &maxAmountPerPayment=5&maxNumberOfPayments=2&maxTotalAmountOfAllPayments=5&pinType=NOT_REQUIRED&returnUrl=http://www.bytelyte.com/PayPal_X_NVP_tester.php?cmd=test&startingDate=27.01.11&senderEmail=krish_1297240918_per@gmail.com//www.bytelyte.com/PayPal_X_NVP_tester.php?cmd=test&startingDate=27.01.11&senderEmail=krish_1297240918_per@gmail.com";

NSData *postData = [url dataUsingEncoding:NSASCIIStringEncodinallowLossyConversion:YES];
[request setCachePolicy:NSURLRequestUseProtocolCachePolicy];
[request setTimeoutInterval:1.0];
[request setHTTPMethod:@"POST"];

[request setValue:@"XXYYZZZZ" forHTTPHeaderField:@"X-PAYPAL-SECURITY-USERID"];
[request setValue:@"XXYYZZZZ" forHTTPHeaderField:@"X-PAYPAL-SECURITY-PASSWORD"];
[request setValue:@"XXYYZZZZ" forHTTPHeaderField:@"X-PAYPAL-SECURITY-SIGNATURE"];
[request setValue:@"NV" forHTTPHeaderField:@"X-PAYPAL-REQUEST-DATA-FORMAT"];
[request setValue:@"NV" forHTTPHeaderField:@"X-PAYPAL-RESPONSE-DATA-FORMAT"];

[request setValue:@"127.0.0.1" forHTTPHeaderField:@"X-PAYPAL-DEVICE-IPADDRESS"];
[request setValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"utf-8" forHTTPHeaderField:@"charset"];

The Response I have got is the following:
responseEnvelope.timestamp=2011-02-09T05%3A02%3A38.859-08%3A00&responseEnvelope.ack=Failure&responseEnvelope.correlationId=981f044262212&responseEnvelope.build=1655692&error(0).errorId=560029&error(0).domain=PLATFORM&error(0).severity=Error&error(0).category=Application&error(0).message=The+required+X-PAYPAL-APPLICATION-ID+header+is+missing+from+the+HTTP+request&error(0).parameter(0)=X-PAYPAL-APPLICATION-ID
Am I missing something or this is entirely not possible? 

A:

@Krishnan, seems you are missing a HTTP header called X-PAYPAL-APPLICATION-ID.