asp.net에서 ISBN 번호를 사용하여 책을 검색하는 데 amazon API를 사용할 수있는 방법은 무엇입니까?Asp.net을 사용하는 Amazon Book Search API
5
A
답변
2
http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl 위에서 주어진 URL 에 대해 svcutil.exe를 사용하여 프록시를 만든 다음 GetBookByISBN 방법입니다. AmazonBook은 자신 만의 독창적 인 DTO입니다.
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
당신은 당신이 nuget에 쉽게 설치할 수있는이 라이브러리 Nager.AmazonProductAdvertising을 사용할 수 있습니다.
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. Python 또는 Ruby 용 Amazon Book API?
- 2. fancybox와 함께 ASP.NET을 사용하는 Facebook 그래프 API
- 3. Facebook api search.
- 4. Amazon Product Search - 서비스 URI 란 무엇입니까?
- 5. Lightweight Search Indexing API/Lbrary
- 6. AMAZON API 인증 오류
- 7. Amazon Reseller API
- 8. ASP.Net을 사용하는 셀렌?
- 9. asp.net을 사용하는 나이지리아 시간
- 10. Bing Search API : 날짜 범위 좁히기
- 11. Simple Bing News Search Api - 구문 검색
- 12. bing search api ajax가 작동하지 않습니다.
- 13. google search api 결과가 나타나지 않습니다.
- 14. Bing News Search API 결과 검색
- 15. Twitter Search API - 사용할 수 없습니까?
- 16. Python 용 Amazon API 라이브러리?
- 17. Amazon Product API and Rails
- 18. Amazon API - 제품 설명 검색
- 19. C# Amazon Product Advertising API
- 20. Amazon Product Advertising API asp.net 및 C#
- 21. facebook 연결 문제가 asp.net을 사용하는 API에 연결
- 22. ASP.NET을 사용하는 동적 N 레이어
- 23. case AuthenticationStatus.Failed : asp.net을 사용하는 openid에서
- 24. ASP.NET을 사용하는 DropDownList에서 오류가 발생했습니다.
- 25. asp.net을 사용하는 오류 메시지 처리
- 26. IIS/ASP.NET을 사용하는 AJAX 역방향
- 27. ASP.NET을 사용하는 Access 데이터베이스와의 CRUD
- 28. asp.net을 사용하는 REST 웹 서비스
- 29. asp.net을 사용하는 Youtube 비디오 업로드
- 30. Asp.Net을 사용하여 ebay, amazon 등과 같은 동적 목록을 만듭니다.
이 WCF 서비스 참조는 다음과 같습니다 라이브러리는 또한 .NET 표준 2.0
당신은 asp.net Website 구현 예를 여기
짧은 예를 찾을 수 있습니다을 지원합니까? SOAP 웹 서비스에 더 관심이 있습니다. –
태그를 연결 하시겠습니까? 액세스 키는 있지만 연관 태그는 볼 수 있습니까? –
어소시에이트 태그는 Amazon을 특정 Amazon 계정에서 Amazon으로 리디렉션 한 Amazon 사용자를 추적하는 데 사용되는 태그입니다. 자세한 정보는 https://forums.aws.amazon.com/thread.jspa?messageID=149729 –