Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6036813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:58:49+00:00 2026-05-23T05:58:49+00:00

i am trying to return just one piece of data from amazon by connecting

  • 0

i am trying to return just one piece of data from amazon by connecting to it like this:

using System;
using System.Collections.Generic;
using System.Text;
using AmazonProductAdvtApi;
using Microsoft.Web.Services3.Addressing;
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;
using System.Net;

namespace AmazonProductAdvtApi
{
    class HmacSample
    {
        // Note: protocol must be https for signed SOAP requests.
        const String DESTINATION    = "https://ecs.amazonaws.com/onca/soap?Service=AWSECommerceService";

        // Set your AWS Access Key ID and AWS Secret Key here.
        // You can obtain them at:
        // http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key
        const String MY_AWS_ID = "MY_SECRET"; //yes it's there in  the real code
        const String MY_AWS_SECRET = "ANOTHER_SECRET"; //yes it's there in the real code

        // Select an item you wish to inspect and provide it's ASIN here:
        const String ITEM_ID = "0345505344";

        static void Main(string[] args)
        {
            // If you are using a debugging proxy like Fiddler to capture SOAP
            // envelopes, and you get SSL Certificate warnings, uncomment the 
            // following line:
            // ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

            // Create an ItemLookup request, with ResponseGroup "Small"
            // and using the item ID provided above.
            ItemLookup itemLookup = new ItemLookup();
            itemLookup.AWSAccessKeyId = MY_AWS_ID;

            ItemLookupRequest itemLookupRequest = new ItemLookupRequest();
            itemLookupRequest.ItemId = new String[] { ITEM_ID };
            itemLookupRequest.ResponseGroup = new String[] { "Small", "AlternateVersions" };
            itemLookup.Request = new ItemLookupRequest[] { itemLookupRequest };

            // create an instance of the serivce
            AWSECommerceService api = new AWSECommerceService();

            // set the destination
            api.Destination = new Uri(DESTINATION);

            // apply the security policy, which will add the require security elements to the
            // outgoing SOAP header
            AmazonHmacAssertion amazonHmacAssertion = new AmazonHmacAssertion(MY_AWS_ID, MY_AWS_SECRET);
            api.SetPolicy(amazonHmacAssertion.Policy());

            // make the call and print the title if it succeeds
            try
            {
                ItemLookupResponse itemLookupResponse = api.ItemLookup(itemLookup);
                Item item = itemLookupResponse.Items[0].Item[0];
                System.Console.WriteLine(item.ItemAttributes.Title);
            }
            catch (Exception e)
            {

                System.Console.Error.WriteLine(e);
            }

            // we're done
            System.Console.WriteLine("HMAC sample finished. Hit Enter to terminate.");
            System.Console.ReadLine();
        }
    }
}

and i am getting the following exception.

{"WSE101: An asynchronous operation raised an exception."}
"Microsoft.Web.Services3.AsynchronousOperationException: WSE101: An asynchronous operation raised an exception. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.

Server stack trace: 
   at System.Net.HttpWebRequest.GetResponse()
   at Microsoft.Web.Services3.Messaging.SoapHttpTransport.Send(SoapEnvelope message, EndpointReference destination, SoapHttpChannelOptions options)
   at Microsoft.Web.Services3.Messaging.SoapHttpOutputChannel.Send(SoapEnvelope message)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
   at Microsoft.Web.Services3.Messaging.SoapOutputChannel.SendDelegate.EndInvoke(IAsyncResult result)
   at Microsoft.Web.Services3.Messaging.SoapOutputChannel.EndSend(IAsyncResult result)
   at Microsoft.Web.Services3.Messaging.SoapSender.EndSend(IAsyncResult result)
   at Microsoft.Web.Services3.Messaging.SoapClient.SoapClientAsyncResult.OnSendComplete(IAsyncResult result)
   --- End of inner exception stack trace ---
   at Microsoft.Web.Services3.AsyncResult.End(IAsyncResult result)
   at Microsoft.Web.Services3.Messaging.SoapClient.SendRequestResponse(String methodname, SoapEnvelope envelope)
   at Microsoft.Web.Services3.Messaging.SoapClient.SendRequestResponse(String methodname, Object obj)
   at AmazonProductAdvtApi.AWSECommerceService.ItemLookup(ItemLookup ItemLookup1) in C:\\Documents and Settings\\agordon\\My Documents\\AmazonProductAdvtApiSampleCSharpSoap\\Client\\src\\AmazonProductAdvtApi.cs:line 218
   at AmazonProductAdvtApi.HmacSample.Main(String[] args) in C:\\Documents and Settings\\agordon\\My Documents\\AmazonProductAdvtApiSampleCSharpSoap\\Sample\\src\\HmacSample.cs:line 88"

can you please help with this issue? i don’t understand what i am doing wrong. i am using an example from amazons website to retrieve product information. its from their product advertising API.

does anyone know if they have something much more supported and new?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:58:50+00:00Added an answer on May 23, 2026 at 5:58 am

    Have you changed the id and secret to your aws id/secret?

        // Set your AWS Access Key ID and AWS Secret Key here.
        // You can obtain them at:
        // http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key
        const String MY_AWS_ID = "secret";
        const String MY_AWS_SECRET = "anothersecret";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to return an array Data Member from one smaller 2D Array
im trying to return a string value from a method inside my script tag
I'm trying to return a dictionary from a function. I believe the function is
I'm trying to return a transparent GIF from an .aspx page for display within
I'm trying to return a record from LINQ2SQL as a JsonResult to update my
I'm trying to return sequence.nextval to my program from a proc stored in a
Trying to create a list to return some JSON data to a view. Following
I am trying to return the result that I found in my query to
I'm trying to return an iterator for a vector in a templated class (I'm
I am trying to return the physical file path of a database's mdf/ldf files.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.