File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Up and Running, not so much. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Up and Running, not so much." Watch "Up and Running, not so much." New topic

Up and Running, not so much.

Karl Krasnowsky
Ranch Hand

Joined: Jan 16, 2009
Posts: 97
Hi folks,
I've seen references in the forum mentioning the use of Martin Kalin's book "Java Web Services: Up and Running" as a good jumping off book into the wonderful world of Web Services.
I've been working through it and hit a stumbling bump in chapter 2 (specifically instructions leading up to and including the Wrapped Style client code that's presented on pages 41-42) that uses the Amazon E-Commerce site as a model for building clients against the wsdl generated access code.
Can others here who have used this book vouch for the reliability of this example code? I'm getting an error:

which I believe indicates that the item that I'm attempting to use as a search index (Books) is no longer valid? I've tried this with my code and the example code directly for the book.

Sorry to be posting this here, I can't find a forum specifically for this book (if there is one you know of, please send the link my way).

thanks in advance for any help on this,

[SCJP 6]
[SCBCD in process]
Karl Krasnowsky
Ranch Hand

Joined: Jan 16, 2009
Posts: 97
Given that nobody had anything to contribute to this topic, I'll answer it myself and provide pointers for others who might be using this book.
The example I'm sighting from this book is now out of date due to an added security layer added by the Amazon ECommerce API.
For those interested a couple of additions need to be provided to source and dependencies to support this.

1) You need to get a copy of the AwsHandlerResolver class and add it to your project.
2) You also need to add commons-codec-1.3.jar to your project's dependencies.
I got these from here (Amazon's development site)

BTW, you need to change the name of the AwsHandlerResolver java file to match the class name, download will format it all lower case.

now the code change:

Of course you can set this up any way you like. I added a 2nd argument that passes in the "Secret" amazon ID.

Hope this helps someone out there...

Denis Zjukow
Ranch Hand

Joined: Mar 15, 2006
Posts: 39
Thanks Karl,

AwsHandlerResolver works fine!
Wiked Vicky Malhotra

Joined: Dec 11, 2010
Posts: 10
Thanks karl!!!

I was feeling outrageous after not getting the code in the book to run. I am new to JAX-WS and started reading this book.

I would appreciate you sharing the resolution.

Wiked Vicky Malhotra

Joined: Dec 11, 2010
Posts: 10

I have an issue with another example in this book. The WS Security example in chapter 5 does not run according to the book.

I submitted the issue at following link:

Karl, Could you help me on this? Have you tried this WS security example.

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
I am also getting same error while executing AmazonClientW. I have made the changes as suggested, but what would be the value of secret_key.

SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Joey Jackson

Joined: Dec 08, 2011
Posts: 4
I am attempting to run this book exercise and have followed the steps outlined in the above recommendation. my client file looks like this: when I run the client java -cp .;commons-codec-1.3.jar AmazonClientW nothing gets printed and I dont get any exceptions. any one have any suggestions why?

An Tran

Joined: Jan 25, 2012
Posts: 2
I got into the same problem and found a solution at

The last post attached a revised copy of AwsHandlerResolver which prints request/response xml.

It turned out that AssociateTag is required, so I added search.setAssociateTag(""); and the example worked.
Jakob Havstein Eriksen

Joined: Mar 20, 2012
Posts: 1
This is what I had to do to get the code example working:

Generate stubs from this version of the wsdl:

Remove search.getSubscriptionId() from call to port.itemSearch() in

Add search.setAssociateTag("") on the ItemSearch variable.

Get the from this post:

Add the line service.setHandlerResolver(new AwsHandlerResolver("<Your Secret Key>")) to set the HandlerResolver on the AWSECommerceService in
Cosmin Nicolae Vacaroiu
Ranch Hand

Joined: Feb 10, 2011
Posts: 55

Worked for me. Thanks.

SCJP 6 (93%), SQL Expert 11g (95%), SCWCD 6 (84%), OCE-EJBD 6 (98%), OCE-JPAD 6 (93%)
Narayanan Ramachandran

Joined: Dec 18, 2012
Posts: 3
Cosmin Nicolae Vacaroiu wrote:Worked for me. Thanks.

Hi Team,

The SOAP call was successful and the operation succeeded without any issue. But the call is always returning 0 records. Any idea? I have done all the changes as suggested by Karl.

Also I am not able to submit this using SOAP UI also. It is always throwing the below fault. Please advise on the same as well.

<soapenv:Envelope xmlns:soapenv="" xmlns:aws="">
<faultstring>The request must contain the parameter Signature.</faultstring>

Please advise.
I agree. Here's the link:
subject: Up and Running, not so much.
jQuery in Action, 3rd edition