Wie kann Amazon API verwendet werden, um ein Buch mit einer ISBN-Nummer mit asp.net zu suchen?Amazon Book Search API mit Asp.net
5
A
Antwort
2
http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl Proxy verwenden svcutil.exe URL oben angegebenen erstellen für und dann ist dies die Methode zu GetBookByISBN. AmazonBook ist mein Cutom DTO, das du dir selbst erstellen musst.
public static AmazonBook GetBookByISBN(string ISBN)
{
WebConfigHelper wch = new WebConfigHelper("AWSSettings");
AmazonBook book = null;
string AWSAccessKeyId = wch["AccessKey"];
string AssociateTag = wch["AssociateTag"];
string AWSSecKey = wch["SecretKey"];
BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
binding.MaxReceivedMessageSize = int.MaxValue;
AWSECommerceServicePortTypeClient client = new AWSECommerceServicePortTypeClient(
binding,
new EndpointAddress("https://webservices.amazon.com/onca/soap?Service=AWSECommerceService"));
// add authentication to the ECS client
client.ChannelFactory.Endpoint.Behaviors.Add(new AmazonSigningEndpointBehavior(AWSAccessKeyId, AWSSecKey));
ItemSearchRequest request = new ItemSearchRequest();
request.SearchIndex = "Books";
request.Power = "ISBN:" + ISBN.Trim();
request.ResponseGroup = new string[] { "Large" };
request.Sort = "salesrank";
ItemSearchRequest[] requests = new ItemSearchRequest[] { request };
ItemSearch itemSearch = new ItemSearch();
itemSearch.AWSAccessKeyId = AWSAccessKeyId;
itemSearch.AssociateTag = AssociateTag;
itemSearch.Request = requests;
try
{
ItemSearchResponse response = client.ItemSearch(itemSearch);
Items info = response.Items[0];
if (info.Item != null)
{
Item[] items = info.Item;
if (items.Length == 1)
{
book = new AmazonBook(items[0]);
}
}
}
catch (Exception ex)
{
throw ex;
}
return book;
}
Reagards,
0
können Sie diese Bibliothek verwenden Nager.AmazonProductAdvertising Sie installieren können, es mit nuget einfach. Die Bibliothek unterstützt auch .NET Standard 2.0
Sie können
PM> Install-Package Nager.AmazonProductAdvertising
Kurz Beispiel hier ein asp.net Website Implementierungsbeispiel finden:
var authentication = new AmazonAuthentication();
authentication.AccessKey = "accesskey";
authentication.SecretKey = "secretkey";
var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.US);
//The Lord of the Rings
var result = wrapper.Lookup("978-0261102385");
Verwandte Themen
- 1. Amazon Search API
- 2. Foto hochladen Book mit REST-API
- 3. bootstrap amazon style search bar
- 4. Amazon Product Advertising API für Asp.net & C#
- 5. Windows Mobile Phone Book API für C#
- 6. Twitter Search API
- 7. Amazon WAF + Amazon API-Gateway
- 8. Roku Channel Search API
- 9. Google Search API Backend
- 10. Wie erhalte ich eine Buchgrafik und eine Beschreibung von der Amazon Book API?
- 11. Ordnungsgemäße Zugriffsrichtlinie für Amazon Elastic Search Cluster
- 12. Mit Amazon EC2 Asp.net Anwendung
- 13. Etwas sinnvolles mit Amazon tun BrowseNodes API
- 14. Wie bekomme ich Buchcover von ISBN mit Google Book API?
- 15. Live Search mit ASP.NET MVC und AJAX
- 16. Hibernate Search programmatische API HTMLStripCharFilterFactory
- 17. appengine Search API vs Datastor
- 18. Sphinx Search Engine & Python API
- 19. Google Custom Search API - Suchergebnisse
- 20. Python amazon api Fehler Verbindung
- 21. Standardauthentifizierung von Bing Search API
- 22. Facebook API Post Search Veraltet?
- 23. Google Search API - Anzahl gefunden
- 24. Wie hostet man ASP.NET API in Amazon Web Services (AWS)?
- 25. Wie man Produkt in Amazon mit amazon api hinzufügen?
- 26. Amazon API Gateway-Timeout
- 27. Amazon API Gateway Benutzerschlüssel
- 28. Amazon API ItemSearch Kategorien
- 29. SignatureDoesNotMatch - Amazon S3 API
- 30. Amazon API-Klasse
dies ist eine WCF-Dienst Referenz? Ich wäre mehr interessiert an SOAP Webservice. –
Assoziierte Marke? Ich kann einen Zugriffsschlüssel sehen, aber ein Tag zuordnen? –
Associate Tag ist etwas, das Amazon verwendet, um zu verfolgen, dass ein Benutzer von einem bestimmten Amazon-Konto zu Amazon umgeleitet wird. Weitere Informationen finden Sie unter https://forums.aws.amazon.com/thread.jspa?messageID=149729 –