亚马逊API认证的错误 [英] AMAZON Api authentication error
本文介绍了亚马逊API认证的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试使用亚马逊的API来获取产品数据和现在失败了。
得到以下错误:(HTTP请求被禁止与客户端身份验证方案'无名氏')
人照顾点我在正确的方向,或提供一个链接到API使用的好例子?
暗淡itemRequest作为新ItemSearchRequest
随着itemRequest
。关键词=黑客帝国
.SearchIndex =DVD
.ResponseGroup =新的String(){图像}
结束与
昏暗的要求作为新ItemSearch
request.AWSAccessKeyId = _AWSAccessKeyId
request.Request =新ItemSearchRequest(){} itemRequest
昏暗的结合作为新basicHttpBinding的(BasicHttpSecurityMode.Transport)
binding.MaxReceivedMessageSize = Integer.MaxValue
昏暗的ServiceProvider作为新AWS_Services.AWSECommerceServicePortTypeClient(结合,新的EndpointAddress(https://webservices.amazon.com/onca/soap?Service=AWSECommerceService))
serviceProvider.ChannelFactory.Endpoint.Behaviors.Add(新AmazonSigningEndpointBehavior(_AssociateTag,_AWSAccessKeyId))
昏暗的响应,ItemSearchResponse = serviceProvider.ItemSearch(要求)
解决方案
原来我用的是不正确_AssociateTag,_AWSAccessKeyId组合。在code其他的一切是正确的......
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)
解决方案
Turns out I was using the incorrect _AssociateTag, _AWSAccessKeyId combination. Everything else in the code was correct...
这篇关于亚马逊API认证的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文