Inheritance: MWSClientCsRuntime.AbstractMwsObject
 public GetProductCategoriesForASINResponse InvokeGetProductCategoriesForASIN()
 {
     // Create a request.
     GetProductCategoriesForASINRequest request = new GetProductCategoriesForASINRequest();
     string sellerId = "example";
     request.SellerId = sellerId;
     string mwsAuthToken = "example";
     request.MWSAuthToken = mwsAuthToken;
     string marketplaceId = "example";
     request.MarketplaceId = marketplaceId;
     string asin = "example";
     request.ASIN = asin;
     return this.client.GetProductCategoriesForASIN(request);
 }
        /// <summary>
        /// Gets categories information for a product identified by
        /// the MarketplaceId and ASIN.
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebServiceProducts service</param>
        /// <param name="request">GetProductCategoriesForASINRequest request</param>
        public static void InvokeGetProductCategoriesForASIN(MarketplaceWebServiceProducts service, GetProductCategoriesForASINRequest request)
        {
            try
            {
                GetProductCategoriesForASINResponse response = service.GetProductCategoriesForASIN(request);

                Console.WriteLine ("Service Response");
                Console.WriteLine ("=============================================================================");
                Console.WriteLine ();

                Console.WriteLine("        GetProductCategoriesForASINResponse");
                if (response.IsSetGetProductCategoriesForASINResult())
                {
                    Console.WriteLine("            GetProductCategoriesForASINResult");
                    GetProductCategoriesForASINResult  getProductCategoriesForASINResult = response.GetProductCategoriesForASINResult;
                    List<Categories> selfList = getProductCategoriesForASINResult.Self;
                    foreach (Categories self in selfList)
                    {
                        Console.WriteLine("                Self");
                        if (self.IsSetProductCategoryId())
                        {
                            Console.WriteLine("                    ProductCategoryId");
                            Console.WriteLine("                        {0}", self.ProductCategoryId);
                        }
                        if (self.IsSetProductCategoryName())
                        {
                            Console.WriteLine("                    ProductCategoryName");
                            Console.WriteLine("                        {0}", self.ProductCategoryName);
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    Console.WriteLine("            ResponseMetadata");
                    ResponseMetadata  responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                        Console.WriteLine("                RequestId");
                        Console.WriteLine("                    {0}", responseMetadata.RequestId);
                    }
                }
                Console.WriteLine("            ResponseHeaderMetadata");
                Console.WriteLine("                RequestId");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.RequestId);
                Console.WriteLine("                ResponseContext");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.ResponseContext);
                Console.WriteLine("                Timestamp");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.Timestamp);
                Console.WriteLine();

            }
            catch (MarketplaceWebServiceProductsException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
                Console.WriteLine("ResponseHeaderMetadata: " + ex.ResponseHeaderMetadata);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get Product Category For ASIN
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnProductCategoriesSearch_Click(object sender, RoutedEventArgs e)
        {
            string SellerId = CommonValue.strMerchantId;
            string MarketplaceId = CommonValue.strMarketplaceId;
            string AccessKeyId = CommonValue.strAccessKeyId;
            string SecretKeyId = CommonValue.strSecretKeyId;
            string ApplicationVersion = CommonValue.strApplicationVersion;
            string ApplicationName = CommonValue.strApplicationName;
            string MWSAuthToken = CommonValue.strMWSAuthToken;
            string strbuff = string.Empty;

            MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig();
            config.ServiceURL = CommonValue.strServiceURL;

            MarketplaceWebServiceProductsClient client = new MarketplaceWebServiceProductsClient(
                                                             ApplicationName,
                                                             ApplicationVersion,
                                                             AccessKeyId,
                                                             SecretKeyId,
                                                             config);
            GetProductCategoriesForASINRequest request = new GetProductCategoriesForASINRequest();
            request.SellerId = SellerId;
            request.MarketplaceId = MarketplaceId;
            request.ASIN = txtProductCategoriesSearchValue.Text.ToString().Trim();
            GetProductCategoriesForASINResponse response = client.GetProductCategoriesForASIN(request);
            if (response.IsSetGetProductCategoriesForASINResult())
            {
                GetProductCategoriesForASINResult getProductCategoriesForASINResult = response.GetProductCategoriesForASINResult;
                List<Categories> selfList = getProductCategoriesForASINResult.Self;
                foreach (Categories self in selfList)
                {
                    strbuff += "カテゴリ名:" + self.ProductCategoryName + System.Environment.NewLine;
                }
                txtProductCategoriesResult.Text = strbuff;
            }
        }
Exemplo n.º 4
0
 public GetProductCategoriesForASINResponse GetProductCategoriesForASIN(GetProductCategoriesForASINRequest request)
 {
     throw new NotImplementedException();
 }