Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Cdub16

macrumors member
Original poster
May 30, 2008
32
0
hey i am on chapter 28 of Aaaron Hillegass' book on cocoa programming. i set up an account on aws.amazon.com with an AWSAccesKeyID but when i use it in my program with this:
Code:
NSString *urlString = [NSString stringWithFormat:
						   @"http://ecs.amazonaws.com/onca/xml"
						   @"Service=AWSECommerceService&"
						   @"AWSAccessKeyID=%@&"
						   @"Operation=ItemSearch&"
						   @"SearchIndex=Books&"
						   @"Keywords=%@&"
						   @"Version=2007-07-16",
						   AWS_ID, searchString];
(with the AWS_ID being the id i just set up.)

the xml i recieve still tells me it has a problem with the AWSAccesKeyID

this is the message i get in the console when i print out the xml:
Code:
<?xml version="1.0" standalone="yes"?><ItemSearchErrorResponse xmlns="http://ecs.amazonaws.com/doc/2007-07-16/"><Error><Code>MissingClientTokenId</Code><Message>Request must contain AWSAccessKeyId or X.509 certificate.</Message></Error><RequestID>a2cbd752-af96-48f5-baa2-c4f51d3ad4c8</RequestID></ItemSearchErrorResponse>

what am i doing wrong??
 
ya thanks ive been looking into that. got pretty confusing but i got it thanks for the reply
 
I'm having this exact same issue and I can't seem to solve it through the link.

I also have this code [from Hillegass's book]

Code:
#define AWS_ID @"<ID is in here>"

...
	//Create the URL (long string broken into several lines is OK)
	NSString *urlString = [NSString stringWithFormat:
					   @"http://ecs.amazonaws.com/onca/xml?"
						   @"Service=AWSECommerceService&"
						   @"AWSAccessKeyID=%@&"
						   @"Operation=ItemSearch&"
						   @"SearchIndex=Books&"
						   @"Keywords=%@&"
						   @"Version=2007-07-16",
						   AWS_ID, searchString];


I get the same error as above.

<?xml version="1.0" standalone="yes"?><ItemSearchErrorResponse xmlns="http://ecs.amazonaws.com/doc/2007-07-16/"><Error><Code>MissingClientTokenId</Code><Message>Request must contain AWSAccessKeyId or X.509 certificate.</Message></Error><RequestID>33815e66-73eb-4152-a1e6-98db44c4317f</RequestID></ItemSearchErrorResponse>

If I add the 'signature' stuff that the link requires for 'ItemSearch', I end up getting the same error.

Code:
@"Signature=TuM6E5L9u%2FuNqOX09ET03BXVmHLVFfJIna5cxXuHxiU%3D&"

Likely because I just copied the signature value, and timestamp they had in the example.

What do I need to do to get a proper signature, or to make this work?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.