SOAP-Based Clients Against Amazon’s E-Commerce Service
Chapter 3 has two Java clients against the RESTful Amazon E-Commerce service. The first client parses the XML document from Amazon in order to extract the desired information, in this case the author of a specified Harry Potter book, J. K. Rowling. The second client uses JAX-B to deserialize the returned XML document into a Java object, whose get-methods are then used to extract the same information. This section introduces two more clients against the E-Commerce service; in this case the service is SOAP-based and, therefore, the clients are as well. The SOAP-based clients use a handler, Java code that has access to every outgoing and incoming SOAP message. In the case of Amazon, the handler’s job is to inject into the SOAP request the authentication information that Amazon requires, in particular a digest based on the secretKey used in both of the RESTful clients of Chapter 2. A message digest generated with the secretKey, rather than the secretKey itself, is sent from the client to the Amazon service; hence, the secretKey itself does not travel over the wire. SOAP handlers are the focus of the next chapter; for now, a handler is used but not analyzed.
The SOAP-based clients against Amazon’s E-Commerce service, like the other SOAP-based Java clients in this chapter, rely upon wsimport-generated classes as building blocks. There are some key points about the SOAP-based service and its clients:
The WSDL and wsimport.
The WSDL ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access