AMAZON Api authentication error

一个人想着一个人 提交于 2020-01-04 14:18:20

问题


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)

回答1:


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



来源:https://stackoverflow.com/questions/3278158/amazon-api-authentication-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!