Also, you allow a customized endpoint to be added to the arguments to this program, but
if it??™s not used you just provide the default endpoint URL. The capability to use different endpoints
for the same stubs makes it easy to have one environment for development and one
for production, because you can just switch the endpoint URL used.
You use the AmazonSearchPort class to call remote methods on the Amazon service. If
someone provides the -d flag to the Ruby interpreter, you also dump everything that happens
to STDERR. This allows you to inspect the XML being generated and sent. You need to insert
your own AWS development tag where noted. Then you create a KeywordRequest object, which
holds all the parameters that you want to send to the call. You??™re interested in the keyword
Rails, and page 1. You want to search among everything with type "books", and you want the
smaller result version. That??™s almost all there is to it. You call details on the result, fetch the
book name and author names, and print this in a nice way.
That??™s how simple it is to consume an Amazon web service. Of course, Amazon is one
of the web services that work well with SOAP4R. In other circumstances (or if you want to use
ECS 4) you might not be so lucky. In those cases, SOAP4R breaks down and it??™s hard to fix in
certain cases. That??™s where it would be useful to have Java implementations of SOAP and
WSDL available . . .
SOAP with Java
There are several good frameworks for working with both server- and client-side SOAP and
WSDL in Java.
Pages:
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333