का उपयोग कर अमेज़ॅन बुक सर्च एपीआई एएसपीनेट के साथ एक आईएसबीएन नंबर का उपयोग कर एक पुस्तक खोजने के लिए अमेज़ॅन एपीआई का उपयोग कैसे किया जा सकता है?एएसपीनेट
Q
एएसपीनेट
5
A
उत्तर
2
http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl ऊपर दिए गए यूआरएल के लिए एक svcutil.exe का उपयोग कर प्रॉक्सी बनाएं और फिर इस GetBookByISBN लिए विधि है। अमेज़ॅनबुक मेरा कटऑम डीटीओ है जिसे आपको अपना बनाना है।
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
आप इस पुस्तकालय Nager.AmazonProductAdvertising उपयोग कर सकते हैं आप इसे nuget साथ आसान स्थापित कर सकते हैं।
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");
संबंधित मुद्दे
- 1. एएसपीनेट
- 2. एएसपीनेट
- 3. एएसपीनेट
- 4. एएसपीनेट
- 5. एएसपीनेट
- 6. एएसपीनेट
- 7. एएसपीनेट
- 8. एएसपीनेट
- 9. एएसपीनेट
- 10. एएसपीनेट
- 11. एएसपीनेट
- 12. एएसपीनेट
- 13. एएसपीनेट
- 14. एएसपीनेट
- 15. एएसपीनेट
- 16. एएसपीनेट
- 17. एएसपीनेट
- 18. एएसपीनेट
- 19. एएसपीनेट
- 20. एएसपीनेट
- 21. एएसपीनेट
- 22. एएसपीनेट
- 23. एएसपीनेट
- 24. एएसपीनेट
- 25. एएसपीनेट
- 26. एएसपीनेट
- 27. एएसपीनेट
- 28. एएसपीनेट
- 29. एएसपीनेट
- 30. एएसपीनेट
यह एक WCF सेवा संदर्भ है: पुस्तकालय भी नेट स्टैंडर्ड 2.0
आप यहाँ एक asp.net Website कार्यान्वयन उदाहरण
लघु उदाहरण मिल सकते हैं समर्थन करते हैं? मैं SOAP webservice में अधिक रुचि रखूंगा। –
सहयोगी टैग? मैं एक एक्सेस कुंजी देख सकता हूं लेकिन टैग को जोड़ सकता हूं? –
एसोसिएट टैग कुछ अमेज़ॅन को किसी ट्रैक को ट्रैक करने के लिए उपयोग किया जाता है जिसे अमेज़ॅन को एक निश्चित अमेज़ॅन खाते से रीडायरेक्ट किया जाता है .. अधिक जानकारी https://forums.aws.amazon.com/thread.jspa?messageID=149729 –