using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using com.amazon.webservices;
using System.Xml.Serialization;
using System.IO;
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
string SearchAmazon(string strKeywords, string strSearchIndex)
{
// Create a new instance of the proxy class
AWSECommerceService myProxy = new AWSECommerceService();
// Create a new instance of the ItemSearch class
ItemSearch mySearch = new ItemSearch();
// ItemSearchRequest stores the actual request parameters
ItemSearchRequest mySearchRequest = new ItemSearchRequest();
// Set some parameters, Keyword and Search Index
mySearchRequest.Keywords = strKeywords;
mySearchRequest.SearchIndex = strSearchIndex;
// Just need Small results, not the full enchilada
mySearchRequest.ResponseGroup = new string[] { "Medium", "Request"};
// Set the subscription and associate tags here
mySearch.AWSAccessKeyId = ConfigurationManager.AppSettings["AWSAccessKeyId"];
mySearch.AssociateTag = ConfigurationManager.AppSettings["AssociateTag"];
// Setup request
mySearch.Request = new ItemSearchRequest[] { mySearchRequest };
// Execute the request and get the response
ItemSearchResponse myResponse = myProxy.ItemSearch(mySearch);
// Parse the response and return the results in HTML
string strHTML = "";
foreach (Items myItems in myResponse.Items)
{
foreach (Item myItem in myItems.Item)
{
// Get the results in HTML
strHTML += FormatAsHTML(myItem);
}
}
return strHTML;
}
///