views:

21

answers:

1

Hi all,

Attempting to use the amazon API to obtain product data and currently failing miserably.

Getting the following error: (The HTTP request was forbidden with client authentication scheme 'Anonymous'.)

Anyone care to point me in the right direction or provide a link to good example of the API usage?

Dim itemRequest As New ItemSearchRequest

With itemRequest
    .Keywords = "Matrix"
    .SearchIndex = "DVD"
    .ResponseGroup = New String() {"Images"}
End With

Dim request As New ItemSearch
request.AWSAccessKeyId = _AWSAccessKeyId
request.Request = New ItemSearchRequest() {itemRequest}

Dim binding As New BasicHttpBinding(BasicHttpSecurityMode.Transport)
binding.MaxReceivedMessageSize = Integer.MaxValue

Dim serviceProvider As New AWS_Services.AWSECommerceServicePortTypeClient(binding, New EndpointAddress("https://webservices.amazon.com/onca/soap?Service=AWSECommerceService"))


serviceProvider.ChannelFactory.Endpoint.Behaviors.Add(New AmazonSigningEndpointBehavior(_AssociateTag, _AWSAccessKeyId))

Dim response As ItemSearchResponse = serviceProvider.ItemSearch(request)
A: 

Turns out I was using the incorrect _AssociateTag, _AWSAccessKeyId combination. Everything else in the code was correct...

Maxim Gershkovich