Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Amazon FBA Signature problem

Featured Replies

After days of attempts I'd just like to scream... LOL

1. I have been able to do a lot using other peoples examples and amending but I don't know Java.

2. I'm sure straight Java is the best way to go but if I can get this right I can at least speed up SOME of my work while I try to figure out/learn the rest. I've downloaded and played with the java libraries and the scatchpad but to no avail....

I currently use Scriptmaster to adjust prices with a crude method of opening a FFox window and uploading a tab file thru that.

I also have one adapted to generate the HMAC signature to request product data although I didn't write it.

I have tried and tried... and tried to adjust the later to at least create the URL needed to create a shipment with the items I want to ship in it but to no avail. The signature doesn't match what Amazon expects....

I've tried hard coding and many variations....

Sure I would love to manage all my FBA using the Java but it's way beyond me right now, I think, and I can't see that I can afford to pay what it would cost to get it.

Any help, ideas or whatever is appreciated.

FBA_HMAC_signatured.zip

I took a quick look at your code, it mostly looks straightforward. When I run it I get a 'NullPointerException' looks like you're trying to use 'getBytes()' method on an object that has not been instantiated, ie 'null'.

I dont know what amazon FBA is. But if you'd like to hire us to help you implement the interaction with amazon, then please send us the documentation and we can give you an estimate.

  • Author

FBA = Fulfillment by Amazon

And I wish I could afford you guys. I know it would be much easier in the long run. Down the road maybe I can....

"...trying to use 'getBytes()' method on an object that has not been instantiated, ie 'null'."

I don't recall where that was.. I don't have the file in front of me but I'll have to check that in a few minutes.

EDIT :

AKA - Amazon Fulfillment Web Service (Amazon FWS)

Edited by Guest

  • Author

Well I'm not sure which object is the problem.... Hopefully someone can point it out to me.

EDIT:

I added..

import junit.framework.TestCase

 public Object next() {

    try {

      String result = internal.readLine();

      if (result == null) {

	throw new NoSuchElementException();

      }

      else {

	return result;

      }

    }

    catch (IOException e) {

    

      // The original exception is included in the message to notify the 

      // client that an IOException has occurred.

      throw new NoSuchElementException(e.toString());

    }

  }





And get this at the end after running the script...




Script:

import java.io.UnsupportedEncodingException;

import java.security.InvalidKeyException;

import java.security.NoSuchAlgorithmException;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import javax.crypto.Mac;

import junit.framework.TestCase

 public Object next() {

    try {

      String result = internal.readLine();

      if (result == null) {

	throw new NoSuchElementException();

      }

      else {

	return result;

      }

    }

    catch (IOException e) {

    

      // The original exception is included in the message to notify the 

      // client that an IOException has occurred.

      throw new NoSuchElementException(e.toString());

    }

  }



// Get current timestamp



        String timestamp = null;

        Calendar cal = Calendar.getInstance();

        DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.000Z'");

        dfm.setTimeZone(TimeZone.getTimeZone("GMT"));

        timestamp = dfm.format(cal.getTime());



// Encode timestamp



        try {

            timestamp2 = URLE...

Does this mean the null is coming here? And if so any idea on how to fix it?

Finally .. does this need to be in a diff. forum?

Thanks

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.