Aug 13

[Tutorial] Amazon SOAP Product Advertising API from Java – Including Signing of Requests with WS-Security

Tag: amazon,axis,development,java,opensource,tutorial,webservicespmularien @ 11:10 pm

Amazon has made a lot of affiliates unhappy with their updates to the Product Advertising API (ex-Affiliate API). I first covered invoking this API a couple years ago – my, have things changed since then.

On August 15, 2009, Amazon will be requiring all affiliates using the Product Advertising API to digitally sign their API requests. Previously, calls to the web service required only the AWS Access Key ID. Now, affiliates are required to sign the requests with a private key (and supply the AWS Access Key ID!) in order for the request to be accepted.

Unfortunately, many affiliates feel that Amazon has really botched this transition. Very little documentation is available on how to sign requests, and the majority of the responses in the affiliate community forum are unanswered by Amazon staff. Additional bad news for Java users is that Amazon has apparently dropped their Java library (Amazon A2S), which used to nicely abstract the ugliness of making requests to the web service.

In this tutorial, we’ll implement an Amazon Product Advertising API client using Apache Axis2 1.5, invoking the API’s SOAP methods. We’ll sign the requests using a PKCS 12 (.p12) file. Get some popcorn – this is a very long and involved process :(

Generating and Converting the AWS Certificate

If you don’t already have it, you’ll need to sign up for an Amazon Web Services (AWS) account. Note that for whatever reason, Amazon has kept the Product Advertising API out of the list of web services available via AWS. One assumes that they will eventually move it over under the AWS umbrella. Log into your AWS account and navigate to the “Access Identifiers” section.

Create a new certificate using the following steps:

create_cert

create_cert_confirm

Download both the public and private keys. Note that the public certificate filename starts with “cert-” and the private key starts with “pk-”.

download_certificate

download_private_key

Now that you have both public and private halves of the keypair, you’ll need to combine them into a PKCS12 file.

Combining Public and Private Keys into a P12 File

In order to use the keypair for request signing, we’ll need to combine the certificate and private key into a PKCS12 file. Youll need OpenSSL for Windows to do this. Download OpenSSL for Windows, install it, and use something like the following command to combine the certificate and private key into a PKCS12 file:

openssl pkcs12 -export -name amaws -out amazon_ws.p12
  -in cert-F52WIEADN2XZTS3SKYQVZIIT5L2MED5Z.pem -inkey pk-F52WIEADN2XZTS3SKYQVZIIT5L2MED5Z.pem

(Note the above is on a single line!) The “-in” is the public certificate and the “-inkey” is the private key. The file generated is noted (“amazon_ws.p12″), and the key alias is defined with the “-name” parameter (“amaws”). You’ll be prompted for a password after running this command. Write it down! We’ll need all these bits of information later, when we configure Axis2.

Downloads Required

You’ll need to download the following Java packages to complete this exercise:

Generating Axis2 Client from WSDL

Next we’ll use the Axis2 wsdl2java tool to generate Java client stubs from the Amazon Product Advertising API WSDL. You can download the WSDL from here to review it, but the Axis2 1.5 wsdl2java tool will actually pull down the WSDL from the HTTP URL directly. The following command will generate a suitable client:

cd C:\thirdparty\axis2-1.5\bin
wsdl2java -o gen -s -p com.amazon.webservices.awsecommerceservice -ap -u -Emp com.amazon.webservices.awsecommerceservice.ext
  -ns2p http://webservices.amazon.com/AWSECommerceService/2009-07-01=com.amazon.webservices.awsecommerceservice.types
  -uri http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl

Note that some of these options are very important! The options presented will split the WSDL types out into separate Java classes, in the com.amazon.webservices.awsecommerceservice.types package.

Do not use the Eclipse-based Axis2 generator to generate the client! The WSDL is so complicated that it will generate a huge Java file that will most likely crash Eclipse when you open it.

Configuring Axis2

Axis2 is a very complicated product, with very poor documentation on client configuration. I’ve done a lot of the work from available examples, and review of the source, to determine how the product needs to be configured to work with request signatures.

Basic Client Source Code

The Java code that I provide here can be freely used, modified, and republished. Please try to link back to my blog if you publish :)

I built this as a library intended to be reused and extended. The example below does a simple ItemLookup, but you can pretty easily add new API commands by following the WSDL and generated objects.

/**
 * Copyright 2009, Peter Mularien. You may freely reuse or modify this code provided that
 * you retain a link back to my site: http://www.mularien.com/blog - thanks!
 */
package com.mularien.amazon;
 
import java.io.InputStream;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;
 
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.client.Options;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.databinding.types.PositiveInteger;
import org.apache.axis2.engine.Handler;
import org.apache.axis2.engine.Phase;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyEngine;
import org.apache.rampart.RampartMessageData;
import org.apache.rampart.handler.PostDispatchVerificationHandler;
import org.apache.rampart.handler.RampartReceiver;
 
import com.amazon.webservices.awsecommerceservice.AWSECommerceServiceStub;
import com.amazon.webservices.awsecommerceservice.types.*;
 
/**
 * @author Mularien
 *
 */
public class AmazonProductSearch {
 
	String amazonWsAccessKey;
	AWSECommerceServiceStub client;
 
	public AmazonProductSearch(String amazonWsKey) throws Exception {
		super();
 
		this.amazonWsAccessKey = amazonWsKey;
 
        ClassLoader loader = AmazonProductSearch.class.getClassLoader();
 
        ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromURIs(loader.getResource("client.axis2.xml"), null);
	client = new AWSECommerceServiceStub(ctx);
        Options options = client._getServiceClient().getOptions();
        client._getServiceClient().getOptions().setProperty(AddressingConstants.INCLUDE_OPTIONAL_HEADERS,Boolean.TRUE);
 
        InputStream resource = loader.getResourceAsStream("policy.xml");
        Policy policy = PolicyEngine.getPolicy(resource);
        options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, policy);
        // work around Rampart? bug which expects SOAP headers in the response
        for(Phase phase : ctx.getAxisConfiguration().getInFlowPhases())
        {
        	if(phase.getName().equals("Security")) {
		        for(Handler handler : phase.getHandlers()) {
		        	if(handler instanceof RampartReceiver) {
		        		phase.removeHandler(handler.getHandlerDesc());
		        	}
		        }
        	}
        	if(phase.getName().equals("Dispatch")) {
		        for(Handler handler : phase.getHandlers()) {
		        	if(handler instanceof PostDispatchVerificationHandler) {
		        		phase.removeHandler(handler.getHandlerDesc());
		        	}
		        }        		
        	}
        }
	}
 
	public String getCartPrice(Item_type3 item) throws Exception {
		CartCreate cart = new CartCreate();
		CartCreate_type0 cartCreate = new CartCreate_type0();
		cartCreate.setAWSAccessKeyId(amazonWsAccessKey);
		CartCreateRequest cartCreateRequest = new CartCreateRequest();
		Items_type0 items = new Items_type0();
		Item_type0 cartItem = new Item_type0();
		cartItem.setASIN(item.getASIN());
		PositiveInteger qty = new PositiveInteger("1");
		cartItem.setQuantity(qty);
		items.addItem(cartItem);
		cartCreateRequest.setItems(items);
		cartCreate.addRequest(cartCreateRequest);
		cart.setCartCreate(cartCreate);
		CartCreateResponse resp = client.cartCreate(cart);
		Price cartPrice = resp.getCartCreateResponse().getCart()[0].getCartItems().getCartItem()[0].getPrice();
		return cartPrice.getFormattedPrice();
	}
 
	public Item_type3 getAmazonInfo(String asin) throws RemoteException, Exception
	{
        ItemLookup lookup = new ItemLookup();
		ItemLookup_type0 lookupType = new ItemLookup_type0();
		lookup.setItemLookup(lookupType);
		ItemLookupRequest itemLookup = new ItemLookupRequest();
		lookupType.addRequest(itemLookup);
		lookupType.setAWSAccessKeyId(amazonWsAccessKey);
 
		String[] itemIds = new String[]{asin};
		itemLookup.setItemId(itemIds);
		itemLookup.setMerchantId("Amazon");
 
		List<String> responseGroups = new ArrayList<String>();
		responseGroups.add("ItemAttributes");
		responseGroups.add("OfferFull");
		responseGroups.add("Images");
		responseGroups.add("Reviews");
		responseGroups.add("Medium");
		itemLookup.setResponseGroup(responseGroups.toArray(new String[]{}));
 
		// build Amazon Client
		ItemLookupResponse response = client.itemLookup(lookup);
		for(Items_type3 items : response.getItemLookupResponse().getItems()) {
			Request_type0 request = items.getRequest();
			if(request.getErrors() != null)
			{
				for(Error_type0 error : request.getErrors().getError())
				{
					System.out.println("Error: "+error.getMessage());
				}
			}
 
			if(items.getItem() != null && items.getItem().length > 0)
			{
				return items.getItem()[0];
			}
		}
		return null;
	}
}

On your classpath, you’ll need everything in the Axis2 1.5 lib directory, and the Rampart 1.4 libraries. You’ll also need some additional configuration files available on the classpath when this class is run.

Axis2 1.5 Client Configuration file (client.axis2.xml)

Unfortunately, documentation of Axis2 client configuration is practically non-existent. I cobbled this configuration file together from some of the Rampart sample implementations. Drop the following into a file called client.axis2.xml, and ensure it’s available on your Amazon client’s runtime classpath:

<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements. See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership. The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
 
<axisconfig name="AxisJava2.0">
    <!-- ================================================= -->
    <!-- Parameters -->
    <!-- ================================================= -->
    <parameter name="hotdeployment">true</parameter>
    <parameter name="hotupdate">false</parameter>
    <parameter name="enableMTOM">false</parameter>
    <parameter name="enableSwA">false</parameter>
 
    <!--Uncomment if you want to enable file caching for attachments -->
    <!--parameter name="cacheAttachments">true</parameter>
    <parameter name="attachmentDIR"></parameter>
    <parameter name="sizeThreshold">4000</parameter-->
 
    <!--Uncomment if you want to enable the reduction of the in-memory cache of WSDL definitions -->
    <!--In some server environments, the available memory heap is limited and can fill up under load -->
    <!--Since in-memory copies of WSDL definitions can be large, some steps can be taken-->
    <!--to reduce the memory needed for the cached WSDL definitions. -->
    <!--parameter name="reduceWSDLMemoryCache">true</parameter-->
 
    <!--This will give out the timout of the configuration contexts, in milliseconds-->
    <parameter name="ConfigContextTimeoutInterval">30000</parameter>
 
    <!--During a fault, stack trace can be sent with the fault message. The following flag will control -->
    <!--that behavior.-->
    <parameter name="sendStacktraceDetailsWithFaults">true</parameter>
 
    <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
    <!--is set, then Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
    <parameter name="DrillDownToRootCauseForFaultReason">true</parameter><!--
 
    <parameter name="userName">admin</parameter>
    <parameter name="password">axis2</parameter>
 
    --><!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
    <!--ServicesDirectory only works on the following cases-->
    <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
    <!---When creating URL Based configurator with URL “file://”  -->
    <!--- War based configurator with expanded case , -->
 
    <!--All the other scenarios it will be ignored.-->
    <!--<parameter name="ServicesDirectory">service</parameter>-->
    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
    <!--<parameter name="ModulesDirectory">modules</parameter>-->
 
 
 
    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
    <!--root which can configured using the following contextRoot parameter-->
    <!--<parameter name="contextRoot">axis2</parameter>-->
 
    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguiush those endpoints-->
    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
    <!--context path to proper Axis2 servlets-->
    <!--<parameter name="servicePath">services</parameter>-->
    <!--<parameter name="restPath">rest</parameter>-->
 
    <!-- Following parameter will completely disable REST handling in Axis2-->
    <parameter name="disableREST" locked="true">false</parameter>
 
    <!-- Following parameter will suppress generation of SOAP 1.2 bindings in auto-generated WSDL files -->
    <parameter name="disableSOAP12" locked="true">false</parameter>
 
    <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
    <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
    <!--<deployer extension=".jsa" directory="rmiservices" class="org.apache.axis2.rmi.deploy.RMIServiceDeployer"/>-->
 
 
    <!-- Following parameter will set the host name for the epr-->
    <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
 
    <!-- If you have a front end host which exposes this webservice using a different public URL  -->
    <!-- use this parameter to override autodetected url -->
    <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
 
 
    <!--    The way of adding listener to the system-->
    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
    <!--        <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
    <!--    </listener>-->
 
    <!-- ================================================= -->
    <!-- Message Receivers -->
    <!-- ================================================= -->
    <!--This is the deafult MessageReceiver for the system , if you want to have MessageReceivers for -->
    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
    <!--any operation -->
    <!--Note : You can ovrride this for a particular service by adding the same element with your requirement-->
     <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
    </messageReceivers>
 
    <!-- ================================================= -->
    <!-- Message Formatter -->
    <!-- ================================================= -->
    <!--Following content type to message formatter mapping can be used to implement support for different message -->
    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
    <messageFormatters>
        <messageFormatter contentType="application/x-www-form-urlencoded"
                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
        <messageFormatter contentType="multipart/form-data"
                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
        <messageFormatter contentType="application/xml"
                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
        <messageFormatter contentType="text/xml"
                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
        <messageFormatter contentType="application/soap+xml"
                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
    </messageFormatters>
 
    <!-- ================================================= -->
    <!-- Message Builders -->
    <!-- ================================================= -->
    <!--Following content type to builder mapping can be used to implement support for different message -->
    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
    <messageBuilders>
        <messageBuilder contentType="application/xml"
                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
        <messageBuilder contentType="application/xml"
                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
        <messageBuilder contentType="application/x-www-form-urlencoded"
                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
        <messageBuilder contentType="multipart/form-data"
                         class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
    </messageBuilders>
 
    <!-- ================================================= -->
    <!-- Transport Ins -->
    <!-- ================================================= -->
    <transportReceiver name="http"
                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port">8080</parameter>
        <!-- Here is the complete list of supported parameters (see example settings further below):
            port: the port to listen on (default 6060)
            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
                                false to minimize bandwidth consumption by combining segments
            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills up         (default 150)
                                       note that default queue never fills up:  see HttpFactory
            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
                                  note that no such threads can exist with default unbounded request queue
            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
        -->
        <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
        <!-- <parameter name="originServer">My-Server/1.1</parameter>           -->
        <!-- <parameter name="requestTimeout">10000</parameter>                   -->
        <!-- <parameter name="requestTcpNoDelay">false</parameter>                   -->
        <!-- <parameter name="requestCoreThreadPoolSize">50</parameter>                      -->
        <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter>                     -->
        <!-- <parameter name="threadKeepAliveTime">240000</parameter>                  -->
        <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter>            -->
    </transportReceiver>
 
    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
        <parameter name="myTopicConnectionFactory">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
        </parameter>
 
        <parameter name="myQueueConnectionFactory">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
        </parameter>
 
        <parameter name="default">
            <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
        </parameter>
    </transportReceiver>-->
 
    <!-- ================================================= -->
    <!-- Non-blocking http/s Transport Listener  -->
 
    <!-- the non blocking http transport based on HttpCore + NIO extensions
    <transportReceiver name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">
        <parameter name="port" locked="false">9000</parameter>
        <parameter name="non-blocking" locked="false">true</parameter>
    </transportReceiver>-->
 
    <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions
    <transportReceiver name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLListener">
        <parameter name="port" locked="false">9002</parameter>
        <parameter name="non-blocking" locked="false">true</parameter>
        <parameter name="keystore" locked="false">
            <KeyStore>
                <Location>identity.jks</Location>
                <Type>JKS</Type>
                <Password>password</Password>
                <KeyPassword>password</KeyPassword>
            </KeyStore>
        </parameter>
        <parameter name="truststore" locked="false">
            <TrustStore>
                <Location>trust.jks</Location>
                <Type>JKS</Type>
                <Password>password</Password>
            </TrustStore>
        </parameter>-->
        <!--<parameter name="SSLVerifyClient">require</parameter>
            supports optional|require or defaults to none -->
    <!--</transportReceiver>-->
 
    <!-- ================================================= -->
    <!-- Mail Transport Listener  -->
    <!-- This is a sample configuration. It assumes a mail server running in localhost.
         Listener pops  messages that comes to the email address red@localhost. Users
         password is red. Listener connect to the server every 3000 milliseconds.
         Parameters with "transport." prefix is Axis2 specific. Others are all from Java Mail API. 
         http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html
     -->
    <!-- ================================================= -->
    <!--<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
        <parameter name="mail.pop3.host">localhost</parameter>
        <parameter name="mail.pop3.user">red</parameter>
        <parameter name="mail.store.protocol">pop3</parameter>
        <parameter name="transport.mail.pop3.password">red</parameter>
        <parameter name="transport.mail.replyToAddress">red@localhost</parameter>
        <parameter name="transport.listener.interval">3000</parameter>
    </transportReceiver>-->
 
    <!--Uncomment if you want to have TCP transport support-->
    <!--transportReceiver name="tcp"
                       class="org.apache.axis2.transport.tcp.TCPServer">
        <parameter name="port">6060</parameter-->>
        <!--If you want to give your own host address for EPR generation-->
        <!--uncomment the following paramter , and set it as you required.-->
        <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
    <!-- /transportReceiver -->
 
    <!-- ================================================= -->
    <!-- Transport Outs -->
    <!-- ================================================= -->
 
    <transportSender name="local"
                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
    <transportSender name="http"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
 
        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
    </transportSender>
 
    <transportSender name="https"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>
    <transportSender name="java"
                     class="org.apache.axis2.transport.java.JavaTransportSender"/>
 
    <!--<transportSender name="jms"-->
                     <!--class="org.apache.axis2.transport.jms.JMSSender"/>-->
 
    <!-- ================================================= -->
    <!-- Non-blocking http/s Transport Sender  -->
 
    <!-- the non-blocking http transport sender based on HttpCore + NIO extensions
    <transportSender name="http"  class="org.apache.axis2.transport.nhttp.HttpCoreNIOSender">
        <parameter name="non-blocking" locked="false">true</parameter>
    </transportSender>-->
 
    <!-- the non-blocking https transport sender based on HttpCore + NIO SSL extensions
    <transportSender name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLSender">
        <parameter name="non-blocking" locked="false">true</parameter>
        <parameter name="keystore" locked="false">
            <KeyStore>
                <Location>identity.jks</Location>
                <Type>JKS</Type>
                <Password>password</Password>
                <KeyPassword>password</KeyPassword>
            </KeyStore>
        </parameter>
        <parameter name="truststore" locked="false">
            <TrustStore>
                <Location>trust.jks</Location>
                <Type>JKS</Type>
                <Password>password</Password>
            </TrustStore>
        </parameter>-->
        <!--<parameter name="HostnameVerifier">DefaultAndLocalhost</parameter>
            supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified -->
    <!--</transportSender>-->
 
    <!-- ================================================= -->
    <!-- Mail Transport Sender  -->
    <!--Only need to uncomment the sender. Configuration is achieved with every client.
        At any instant mail host should be given. Sample configuration has been given.
        http://people.apache.org/~pzf/SMTPBase64Binding-0.2.html
   -->
    <!-- ================================================= -->
   <!--<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="mail.smtp.host">localhost</parameter>
    </transportSender>-->
 
    <!-- ================================================= -->
    <!-- Global Modules  -->
    <!-- ================================================= -->
    <!-- Comment this to disable Addressing -->
    <module ref="addressing"/>
    <module ref="rampart"/>
 
    <!--Configuring module , providing parameters for modules whether they refer or not-->
    <!--<moduleConfig name="addressing">-->
    <!--<parameter name="addressingPara">N/A</parameter>-->
    <!--</moduleConfig>-->
 
    <!-- ================================================= -->
    <!-- Clustering  -->
    <!-- ================================================= -->
    <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
    <!--
    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
        <parameter name="param1">value1</parameter>
        <parameter name="domain">apache.axis2.domain</parameter>
        <parameter name="synchronizeAll">true</parameter>
        <parameter name="maxRetries">10</parameter>
        <configurationManager class="org.apache.axis2.cluster.configuration.TribesConfigurationManager">
            <listener class="org.apache.axis2.cluster.configuration.DefaultConfigurationManagerListener"/>
        </configurationManager>
        <contextManager class="org.apache.axis2.cluster.context.TribesContextManager">
            <listener class="org.apache.axis2.cluster.context.DefaultContextManagerListener"/>
        </contextManager>
    </cluster>
    -->
 
    <!-- ================================================= -->
    <!-- Phases  -->
    <!-- ================================================= -->
    <phaseOrder type="InFlow">
        <!--  System predefined phases       -->
        <phase name="Transport">
            <handler name="RequestURIBasedDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
                <order phase="Transport"/>
            </handler>
            <handler name="SOAPActionBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
                <order phase="Transport"/>
            </handler>
        </phase>
        <phase name="Addressing">
             <handler name="AddressingBasedDispatcher"
                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
                 <order phase="Addressing"/>
            </handler>
        </phase>
        <phase name="Security"/>
        <phase name="PreDispatch"/>
        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
            <handler name="RequestURIBasedDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
            <handler name="SOAPActionBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
            <handler name="RequestURIOperationDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
            <handler name="SOAPMessageBodyBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
 
            <handler name="HTTPLocationBasedDispatcher"
                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
        </phase>
        <phase name="RMPhase"/>
        <!--  System predefined phases       -->
        <!--   After Postdispatch phase module author or service author can add any phase he want      -->
        <phase name="OperationInPhase"/>
        <phase name="soapmonitorPhase"/>
    </phaseOrder>
    <phaseOrder type="OutFlow">
        <!--      user can add his own phases to this area  -->
        <phase name="soapmonitorPhase"/>
        <phase name="OperationOutPhase"/>
        <!--system predefined phase-->
        <!--these phase will run irrespective of the service-->
        <phase name="RMPhase"/>
        <phase name="PolicyDetermination"/>
        <phase name="Security"/>
        <phase name="MessageOut"/>
    </phaseOrder>
    <phaseOrder type="InFaultFlow">
        <phase name="Addressing">
             <handler name="AddressingBasedDispatcher"
                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
                 <order phase="Addressing"/>
            </handler>
        </phase>
        <phase name="Security"/>
        <phase name="PreDispatch"/>
        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
            <handler name="RequestURIBasedDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
            <handler name="SOAPActionBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
            <handler name="RequestURIOperationDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
            <handler name="SOAPMessageBodyBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
 
            <handler name="HTTPLocationBasedDispatcher"
                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
        </phase>
        <phase name="RMPhase"/>
        <!--      user can add his own phases to this area  -->
        <phase name="OperationInFaultPhase"/>
        <phase name="soapmonitorPhase"/>
    </phaseOrder>
    <phaseOrder type="OutFaultFlow">
        <!--      user can add his own phases to this area  -->
        <phase name="soapmonitorPhase"/>
        <phase name="OperationOutFaultPhase"/>
        <phase name="Security"/>
        <phase name="RMPhase"/>
        <phase name="PolicyDetermination"/>
        <phase name="MessageOut"/>
    </phaseOrder>
</axisconfig>

Note that there’s nothing specific to Amazon in this file. We have added bits to this file to handle configuration of the Rampart-related phase handlers. Rampart is responsible for implementing WS-Security handlers. We’ll need to configure Rampart by providing a policy.xml file, which defines a WS-Security policy. The policy.xml file is where you’ll do the bulk of the configuration for your PKCS12 key store:

<?xml version="1.0" encoding="UTF-8"?>
<!--
 !
 ! Copyright 2006 The Apache Software Foundation.
 !
 ! Licensed under the Apache License, Version 2.0 (the "License");
 ! you may not use this file except in compliance with the License.
 ! You may obtain a copy of the License at
 !
 !      http://www.apache.org/licenses/LICENSE-2.0
 !
 ! Unless required by applicable law or agreed to in writing, software
 ! distributed under the License is distributed on an "AS IS" BASIS,
 ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ! See the License for the specific language governing permissions and
 ! limitations under the License.
 !-->
<wsp:Policy wsu:Id="SigOnly" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
	<wsp:ExactlyOne>
		<wsp:All>
			<sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
				<wsp:Policy>
					<sp:InitiatorToken>
						<wsp:Policy>
							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
								<wsp:Policy>
								    <sp:RequireThumbprintReference/> 
									<sp:WssX509V3Token10/>
								</wsp:Policy>
							</sp:X509Token>
						</wsp:Policy>
					</sp:InitiatorToken>
					<sp:RecipientToken>
						<wsp:Policy>
							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
								<wsp:Policy>
								    <sp:RequireThumbprintReference/>
									<sp:WssX509V3Token10/>
								</wsp:Policy>
							</sp:X509Token>
						</wsp:Policy>
					</sp:RecipientToken>
					<sp:AlgorithmSuite>
						<wsp:Policy>
							<sp:TripleDesRsa15/>
						</wsp:Policy>
					</sp:AlgorithmSuite>
					<sp:Layout>
						<wsp:Policy>
							<sp:Strict/>
						</wsp:Policy>
					</sp:Layout>
					<sp:IncludeTimestamp/>
					<sp:OnlySignEntireHeadersAndBody/>
				</wsp:Policy>
			</sp:AsymmetricBinding>
			<sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
				<wsp:Policy>
					<sp:MustSupportRefKeyIdentifier/>
					<sp:MustSupportRefIssuerSerial/>
				</wsp:Policy>
			</sp:Wss10>
			<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
				<sp:Body/>
			</sp:SignedParts>
		      <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
		        <ramp:user>amaws</ramp:user><!--
		        <ramp:encryptionUser>amaws</ramp:encryptionUser>
		        --><ramp:passwordCallbackClass>com.mularien.amazon.PWCBHandler</ramp:passwordCallbackClass>
		        <ramp:signatureCrypto>
		          <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
					<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">pkcs12</ramp:property>
					<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">123456</ramp:property>
					<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.alias">amaws</ramp:property>
					<ramp:property name="org.apache.ws.security.crypto.merlin.file">amazon_ws.p12</ramp:property>
		          </ramp:crypto>
		        </ramp:signatureCrypto>        
		      </ramp:RampartConfig>
		</wsp:All>
	</wsp:ExactlyOne>
</wsp:Policy>

You’ll need to adjust the settings in the <ramp:RampartConfig> section to match the username, password, alias, and PKCS12 filename you created. You’ll also need to create the password callback handler class, which will look like this:

package com.mularien.amazon;
 
import org.apache.ws.security.WSPasswordCallback;
 
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
 
import java.io.IOException;
 
public class PWCBHandler implements CallbackHandler {
 
    public void handle(Callback[] callbacks) throws IOException,
            UnsupportedCallbackException {
        for (int i = 0; i &lt; callbacks.length; i++) {
            WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
            String id = pwcb.getIdentifier();
            if("amaws".equals(id)) {
                pwcb.setPassword("123456");
            }
        }
    }
 
}

Here, you’ll have to change the keystore alias and the password as well, to match what you generated using the OpenSSL tool. One more setup step, and then you should be able to run a simple JUnit test to verify the behavior.

Bouncy Castle Installation

You’ll finally need to install the Bouncy Castle encryption libraries, so that Rampart can properly sign the request. Installing Bouncy Castle requires you to install some libraries in your JRE/JDK directory. This takes a series of steps.

  1. Download the Bouncy Castle libraries listed above, and copy them into the jre/lib/ext directory.
  2. Download the “Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6″ and install in jre/lib/security.
  3. Edit the java.security file, adding the Bouncy Castle provider:
security.provider.6=com.sun.security.sasl.Provider
security.provider.7=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.8=sun.security.smartcardio.SunPCSC
security.provider.9=sun.security.mscapi.SunMSCAPI
security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider

#
# Select the source of seed data for SecureRandom. By default an
# attempt is made to use the entropy gathering device specified by

Finally, we’re all set to run the test code!

Sample Test Code

You can use the following JUnit test to test the functionality:

/**
 * Copyright 2009, Peter Mularien. You may freely reuse or modify this code provided that
 * you retain a link back to my site: http://www.mularien.com/blog - thanks!
 */
package com.mularien.amazon;
 
import static org.junit.Assert.*;
import java.rmi.RemoteException;
import org.junit.Test;
import com.amazon.webservices.awsecommerceservice.types.Item_type3;
 
/**
 * @author Mularien
 *
 */
public class TestAmazonProductSearch {
 
	/**
	 * Test method for {@link com.mularien.amazon.AmazonProductSearch#getAmazonInfo(java.lang.String)}.
	 * @throws Exception
	 */
	@Test
	public void testGetAmazonInfo() throws Exception {
		AmazonProductSearch amazonProductSearch = new AmazonProductSearch("YOUR_AWS_ACCESS_KEY_HERE");
		Item_type3 amazonInfo = amazonProductSearch.getAmazonInfo("B001AVOJ50");
		assertNotNull(amazonInfo);
		String price = amazonProductSearch.getCartPrice(amazonInfo);
		assertNotNull(price);
	}
 
}

Obviously, this is a simple test case of the library. You should have no problem extending this to do whatever you need. Remember that once you have Rampart properly configured, all outgoing requests are automatically signed. You don’t even need to think about it!

Running and CLASSPATH Issues

Making sure all the appropriate bits are on the CLASSPATH can be tricky. Here’s a sample ant script I wrote for myself to keep everything straight. Make sure you have the rampart and axis “.mar” files on the CLASSPATH (you can do this in Eclipse, but it’s a bit tricky — .mar !? What were they thinking?). Here’s the sample ant script to run:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="Amazon SOAP API WS-Security Mularien.com Demo">
    <target name="run">
        <java classname="com.mularien.amazon.TestClient">
		<classpath>
			<pathelement location="."/>
			<fileset dir="c:/thirdparty/axis2-1.5/lib" includes="*.jar"/>
			<fileset dir="c:/thirdparty/axis2-1.5/repository/modules" includes="*.mar"/>
			<fileset dir="c:/thirdparty/rampart-1.4/lib" includes="*.jar"/>
			<fileset dir="c:/thirdparty/rampart-1.4/modules" includes="*.mar"/>
			<fileset dir="c:/thirdparty/wss4j" includes="*.jar"/>
			<fileset dir="c:/thirdparty/" includes="bc*.jar"/> <!-- Bouncy Castle -->
		</classpath>
	</java>
    </target>
</project>

Troubleshooting

I’ll try to update this post with some of the common errors I found, but I wanted to hurry up and publish it before the August 15 deadline to make sure people had a chance to try out what I posted :)

Unfortunately, in general the Axis/Rampart error reporting is not that great. Use standard commons-logging configuration techniques, and download the source for the Apache components if you run into trouble.

Related Links

37 Responses to “[Tutorial] Amazon SOAP Product Advertising API from Java – Including Signing of Requests with WS-Security”

  1. » 5 Minute Guide to the Java Amazon Associates Web Service API – It’s Only Software says:

    [...] SOAP requests, which are not supported by the (now defunct) AmazonA2SClient library. Please see my updated article on using the Amazon AWS API (now Product Advertising API) with Java and Apache Axis2. [...]

  2. lars says:

    uff..is there no easier way to access the api?
    looks very complicated..

  3. John says:

    This example still returns an error of: org.apache.axis2.AxisFault: The request must contain the parameter Signature.

    Any idea what could be causing this?

  4. mike says:

    1. I get the same error as John gets!

    2. I’m not familiar with using ant from eclipse. How do I run the ant file? If I right click the ant file and choose external tools configuration, then eclipse complains about the test class missing.

    thanks, mike

  5. luis says:

    Same Issue as John and Mike. I’m sure I’m using everything correctly. Any hits that might help would be appreciated. I put policy.xml, client.axis2.xml, and my amazon_ws.p12 on the root of my project. I’m using the same alias as you “amaws”, the password is different but I corrected that.

    Thanks.

  6. luis says:

    I also included commons-logging and added the following log4j.properties to the root of my project but see this WARN for log4j still, any help?

    log4j:WARN No appenders could be found for logger (org.apache.axis2.util.Loader).
    log4j:WARN Please initialize the log4j system properly.

    # Default Logging Configuration

    log4j.rootLogger=INFO, stdout

    #to increase logging level

    #log4j.logger.org.dcm4cheri=DEBUG

    #to decrease logging level

    #log4j.logger.org.dcm4cheri=ERROR

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender

    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

    log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %-5p %x – %m\n

  7. mike says:

    I solved the `The request must contain the parameter Signature’.

    It turns out that the AmazonProductSearch class wasn’t able to find the xml configuration files, a.o. policy.xml. These files have to be on the classpath in order for getResource() to find them. My solution, in Eclipse: Place all config files and the .p12 file in a separate directory, e.g., config, under the project root, and add this directory to the class path by `configure build path | add class folder’.

    That solved the issue for me.

    What remains is an extremely slow repsonse: about 6 seconds for one amazonProductSearch()…

  8. luis says:

    That got me further, thanks Mike. However, I now get this exception/error:

    org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0×93 (at char #3290, byte #-1)

    Does this indicate a bad response from the server?

  9. luis says:

    Nm, it looks like client.axis.xml was missing the header:

  10. mike says:

    Great Luis!

    Do you also experience slow response times?

  11. BesantBoys says:

    Hi all i am using Query api for EC2.. that is much slower.. anyone using SOAP api.. how is the response time using that api..

    thanks
    besant

  12. mike says:

    Hi all,

    Another issue: The code generated by axis2 seems to be rather cumbersome. Each operation is represented by a normal class and a _type0 class. Both of them have to be used in requests, which is bloody complicated. Anyone knows a solution?

    Bye, Mike

  13. luis says:

    On average it does take like 3-4seconds, and it is complicated, I’m making other methods and refactoring old code from the old api, seems like having to have the requests, the responses, and yet another layer of list and _types is how its done. Also interested if someone has a more efficient way of doing this.

  14. mike says:

    About the _type0 issue: the standard data binding used by axis2 (ADB) causes these classes to be generated. If you specify -d jaxbri you get fewer bean classes, allowing easier programming. (IMHO.) However, it causes the program to run even slower.

  15. FirstTrust Books says:

    Can someone post a sample code that really works with ItemLookup operation through SOAP?
    I have struggled for a while to get this working with signature authentication.

    Regards

  16. M.A.C says:

    This looks a great work! I got all the steps done but one basic step remains.

    Where can I get the broken classess in my eclipse:

    import com.amazon.webservices.awsecommerceservice.AWSECommerceServiceStub;
    import com.amazon.webservices.awsecommerceservice.types.*;

    Are these downlodable from Amazon or did you step created them somewhere?

    Thanks very much for you support.

  17. M.A.C says:

    It did not take me long. They are under: \axis2-1.5\bin\gen

    This should have been mentiond above.

  18. M.A.C says:

    Apologies, if I am a newbies, but I did everything right and I get the following
    excpetion when I run the test code supplied in Eclipse.

    log4j:WARN No appenders could be found for logger (org.apache.axis2.util.Loader).
    log4j:WARN Please initialize the log4j system properly.
    org.apache.axis2.AxisFault: The request must contain the parameter Signature.
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:517)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at com.amazon.webservices.awsecommerceservice.AWSECommerceServiceStub.itemLookup(AWSECommerceServiceStub.java:1159)

  19. pmularien says:

    @M.A.C
    You’ll get that error if you haven’t included the code indicated here:
    // work around Rampart? bug which expects SOAP headers in the response

  20. M.A.C says:

    It is included as in your code, debugged outout is below

    log4j:WARN No appenders could be found for logger (org.apache.axis2.util.Loader).
    log4j:WARN Please initialize the log4j system properly.
    phase.getName() : Security
    phase.getName()::Dispatch
    inside handler
    inside handler
    inside handler
    inside handler
    inside handler
    org.apache.axis2.AxisFault: The request must contain the parameter Signature.
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:517)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at com.amazon.webservices.awsecommerceservice.AWSECommerceServiceStub.itemLookup(AWSECommerceServiceStub.java:1159)

  21. M.A.C says:

    I tried hard to get this to work stand alone but with no luck, I still get the same error, so I have
    now dropped the same code in my web application, since it is the final target system and also it is easier to put all the configuration
    on the class path under the root of WEB-INF, so that all can be resolved.

    Here what I have in the root of my WEB-INF

    addressing-1.5.mar mtompolicy-1.5.mar soapmonitor-1.5.mar
    amazon_ws.p12 ping-1.5.mar client.axis2.xml policy.xml
    lib rahas-1.4.mar web.xml
    mex-1.5.mar rampart-1.4.mar
    modules.list scripting-1.5.mar

    I have also enabled debug, but I am still getting the same error, there seems to be
    something fundmantly wrong here with the request, I get error 400 as a response
    from AMAZON, I hope someone can help me to get this working.

    Here is the full debug code, you can see the service connects to Amazon but returns
    400 due to something wrong with the way the request is put together.

    Any suggesstions are greatly welcome!

    MAC

    [2009-09-29 19:32:19,563] – [DEBUG] – [Trying to find [org/apache/axis2/deployment/axis2_default.xml] using WebappClassLoader
    delegate: false
    repositories:
    /WEB-INF/classes/
    ———-> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@7ff5b6
    class loader.] – [Loader.java:getResourceAsStream:132] –
    [2009-09-29 19:32:19,719] – [DEBUG] – [About to create XMLInputFactory implementation with classloader=WebappClassLoader
    delegate: false
    repositories:
    /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@7ff5b6
    ] – [StAXUtils.java:getXMLInputFactory_perClassLoader:333] –
    [2009-09-29 19:32:19,719] – [DEBUG] – [The classloader for javax.xml.stream.XMLInputFactory is: null] – [StAXUtils.java:getXMLInputFactory_perClassLoader:335] –
    [2009-09-29 19:32:19,797] – [DEBUG] – [Created XMLInputFactory = class com.ctc.wstx.stax.WstxInputFactory with classloader=WebappClassLoader
    delegate: false
    repositories:
    /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@7ff5b6
    ] – [StAXUtils.java:getXMLInputFactory_perClassLoader:382] –
    [2009-09-29 19:32:19,797] – [DEBUG] – [Size of XMLInputFactory map =1] – [StAXUtils.java:getXMLInputFactory_perClassLoader:384] –
    [2009-09-29 19:32:19,813] – [DEBUG] – [isNetworkDetached =false] – [StAXUtils.java:getXMLInputFactory_perClassLoader:385] –
    [2009-09-29 19:32:19,985] – [DEBUG] – [XMLStreamReader is com.ctc.wstx.sr.ValidatingStreamReader] – [StAXUtils.java:createXMLStreamReader:146] –
    [2009-09-29 19:32:20,110] – [DEBUG] – [Builder is already complete.] – [OMNodeImpl.java:build:330] –
    [2009-09-29 19:32:20,281] – [DEBUG] – [Handler RequestURIBasedDispatcher added to Phase Transport] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,297] – [DEBUG] – [Handler SOAPActionBasedDispatcher added to Phase Transport] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,297] – [DEBUG] – [Handler AddressingBasedDispatcher added to Phase Addressing] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,313] – [DEBUG] – [Handler RequestURIBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,313] – [DEBUG] – [Handler SOAPActionBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,328] – [DEBUG] – [Handler RequestURIOperationDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,328] – [DEBUG] – [Handler SOAPMessageBodyBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,328] – [DEBUG] – [Handler HTTPLocationBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,344] – [DEBUG] – [Handler AddressingBasedDispatcher added to Phase Addressing] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,344] – [DEBUG] – [Handler RequestURIBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,344] – [DEBUG] – [Handler SOAPActionBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,344] – [DEBUG] – [Handler RequestURIOperationDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,344] – [DEBUG] – [Handler SOAPMessageBodyBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,360] – [DEBUG] – [Handler HTTPLocationBasedDispatcher added to Phase Dispatch] – [Phase.java:addHandler:98] –
    [2009-09-29 19:32:20,422] – [INFO] – [No repository found , module will be loaded from classpath] – [URLBasedAxisConfigurator.java:getAxisConfiguration:70] –
    [2009-09-29 19:32:20,438] – [DEBUG] – [Deploying module from classpath at 'file:/F:/DevStore/myWorkSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/mex-1.5.jar'] – [RepositoryListener.java:loadClassPathModules:145] –
    [2009-09-29 19:32:20,750] – [DEBUG] – [XMLStreamReader is com.ctc.wstx.sr.ValidatingStreamReader] – [StAXUtils.java:createXMLStreamReader:146] –
    [2009-09-29 19:32:20,766] – [DEBUG] – [Builder is already complete.] – [OMNodeImpl.java:build:330] –
    [2009-09-29 19:32:20,813] – [DEBUG] – [getBundle(org.apache.axis2,org.apache.axis2.i18n,resource,null,...)] – [ProjectResourceBundle.java:getBundle:236] –
    [2009-09-29 19:32:20,860] – [DEBUG] – [loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis2.resource, locale en_US] – [ProjectResourceBundle.java:loadBundle:412] –
    [2009-09-29 19:32:20,860] – [DEBUG] – [Created org.apache.axis2.i18n.resource, linked to parent null] – [ProjectResourceBundle.java:getBundle:289] –
    [2009-09-29 19:32:20,875] – [DEBUG] – [getBundle(org.apache.axis2,org.apache.axis2.i18n,resource,null,...)] – [ProjectResourceBundle.java:getBundle:236] –
    [2009-09-29 19:32:20,875] – [DEBUG] – [org.apache.axis2.i18n.resource::handleGetObject(addingnewmodule)] – [ProjectResourceBundle.java:handleGetObject:70] –
    [2009-09-29 19:32:20,875] – [DEBUG] – [Adding new module] – [DeploymentEngine.java:addNewModule:557] –
    [2009-09-29 19:32:20,891] – [DEBUG] – [org.apache.axis2.i18n.resource::handleGetObject(deployingmodule)] – [ProjectResourceBundle.java:handleGetObject:70] –
    [2009-09-29 19:32:20,891] – [INFO] – [Deploying module: metadataExchange-1.5 - file:/F:/DevStore/myWorkSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/mex-1.5.jar] – [ModuleDeployer.java:deploy:75] –
    [2009-09-29 19:32:31,485] – [DEBUG] – [Start expire sessions StandardManager at 1254249151485 sessioncount 2] – [ManagerBase.java:processExpires:677] –
    [2009-09-29 19:32:31,485] – [DEBUG] – [End expire sessions StandardManager processingTime 0 expired sessions: 0] – [ManagerBase.java:processExpires:685] –
    [2009-09-29 19:32:48,281] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: anonRobustOp; operation: org.apache.axis2.description.RobustOutOnlyAxisOperation@1e5c2ccnamed: {http://ws.apache.org/namespaces/axis2}anonRobustOp] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,281] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:anonRobustOp; operation: org.apache.axis2.description.RobustOutOnlyAxisOperation@1e5c2ccnamed: {http://ws.apache.org/namespaces/axis2}anonRobustOp] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,281] – [DEBUG] – [Client-defined operation name matches default operation name. this may cause interoperability issues. Name is: {http://ws.apache.org/namespaces/axis2}anonOutonlyOp] – [AxisService.java:addOperation:589] –
    [2009-09-29 19:32:48,281] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: anonOutonlyOp; operation: org.apache.axis2.description.OutOnlyAxisOperation@178a4d1named: {http://ws.apache.org/namespaces/axis2}anonOutonlyOp] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:anonOutonlyOp; operation: org.apache.axis2.description.OutOnlyAxisOperation@178a4d1named: {http://ws.apache.org/namespaces/axis2}anonOutonlyOp] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: anonOutInOp; operation: org.apache.axis2.description.OutInAxisOperation@18caeb6named: {http://ws.apache.org/namespaces/axis2}anonOutInOp] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:anonOutInOp; operation: org.apache.axis2.description.OutInAxisOperation@18caeb6named: {http://ws.apache.org/namespaces/axis2}anonOutInOp] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: itemSearch; operation: org.apache.axis2.description.OutInAxisOperation@12263d6named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}itemSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:itemSearch; operation: org.apache.axis2.description.OutInAxisOperation@12263d6named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}itemSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: tagLookup; operation: org.apache.axis2.description.OutInAxisOperation@c89a0fnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}tagLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:tagLookup; operation: org.apache.axis2.description.OutInAxisOperation@c89a0fnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}tagLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: vehicleSearch; operation: org.apache.axis2.description.OutInAxisOperation@1fa7a45named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}vehicleSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,313] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:vehicleSearch; operation: org.apache.axis2.description.OutInAxisOperation@1fa7a45named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}vehicleSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,328] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: listLookup; operation: org.apache.axis2.description.OutInAxisOperation@17167cdnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}listLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,328] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:listLookup; operation: org.apache.axis2.description.OutInAxisOperation@17167cdnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}listLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,328] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: sellerLookup; operation: org.apache.axis2.description.OutInAxisOperation@55c78cnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}sellerLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,328] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:sellerLookup; operation: org.apache.axis2.description.OutInAxisOperation@55c78cnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}sellerLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,328] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: cartClear; operation: org.apache.axis2.description.OutInAxisOperation@19fcbfdnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartClear] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,344] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:cartClear; operation: org.apache.axis2.description.OutInAxisOperation@19fcbfdnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartClear] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,344] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: itemLookup; operation: org.apache.axis2.description.OutInAxisOperation@16cdee6named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}itemLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,344] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:itemLookup; operation: org.apache.axis2.description.OutInAxisOperation@16cdee6named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}itemLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,344] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: transactionLookup; operation: org.apache.axis2.description.OutInAxisOperation@9dee92named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}transactionLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,360] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:transactionLookup; operation: org.apache.axis2.description.OutInAxisOperation@9dee92named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}transactionLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,360] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: browseNodeLookup; operation: org.apache.axis2.description.OutInAxisOperation@99b59cnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}browseNodeLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,360] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:browseNodeLookup; operation: org.apache.axis2.description.OutInAxisOperation@99b59cnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}browseNodeLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,375] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: customerContentSearch; operation: org.apache.axis2.description.OutInAxisOperation@162236fnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}customerContentSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,375] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:customerContentSearch; operation: org.apache.axis2.description.OutInAxisOperation@162236fnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}customerContentSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,375] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: help; operation: org.apache.axis2.description.OutInAxisOperation@464b6named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}help] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,375] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:help; operation: org.apache.axis2.description.OutInAxisOperation@464b6named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}help] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,391] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: listSearch; operation: org.apache.axis2.description.OutInAxisOperation@7013d1named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}listSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,391] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:listSearch; operation: org.apache.axis2.description.OutInAxisOperation@7013d1named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}listSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,391] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: customerContentLookup; operation: org.apache.axis2.description.OutInAxisOperation@2535f5named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}customerContentLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,391] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:customerContentLookup; operation: org.apache.axis2.description.OutInAxisOperation@2535f5named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}customerContentLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,406] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: cartCreate; operation: org.apache.axis2.description.OutInAxisOperation@f9818bnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartCreate] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,406] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:cartCreate; operation: org.apache.axis2.description.OutInAxisOperation@f9818bnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartCreate] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,406] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: sellerListingLookup; operation: org.apache.axis2.description.OutInAxisOperation@a7e1b1named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}sellerListingLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,406] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:sellerListingLookup; operation: org.apache.axis2.description.OutInAxisOperation@a7e1b1named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}sellerListingLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,406] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: vehiclePartSearch; operation: org.apache.axis2.description.OutInAxisOperation@1d2360fnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}vehiclePartSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,438] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:vehiclePartSearch; operation: org.apache.axis2.description.OutInAxisOperation@1d2360fnamed: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}vehiclePartSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,438] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: similarityLookup; operation: org.apache.axis2.description.OutInAxisOperation@1db2007named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}similarityLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,453] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:similarityLookup; operation: org.apache.axis2.description.OutInAxisOperation@1db2007named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}similarityLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,453] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: sellerListingSearch; operation: org.apache.axis2.description.OutInAxisOperation@113c837named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}sellerListingSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,453] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:sellerListingSearch; operation: org.apache.axis2.description.OutInAxisOperation@113c837named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}sellerListingSearch] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,453] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: cartModify; operation: org.apache.axis2.description.OutInAxisOperation@1bd9ca9named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartModify] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,453] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:cartModify; operation: org.apache.axis2.description.OutInAxisOperation@1bd9ca9named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartModify] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,469] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: cartAdd; operation: org.apache.axis2.description.OutInAxisOperation@17858a9named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartAdd] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,469] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:cartAdd; operation: org.apache.axis2.description.OutInAxisOperation@17858a9named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartAdd] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,469] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: multiOperation; operation: org.apache.axis2.description.OutInAxisOperation@4e0d3named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}multiOperation] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,469] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:multiOperation; operation: org.apache.axis2.description.OutInAxisOperation@4e0d3named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}multiOperation] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,485] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: cartGet; operation: org.apache.axis2.description.OutInAxisOperation@445f88named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartGet] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,485] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:cartGet; operation: org.apache.axis2.description.OutInAxisOperation@445f88named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}cartGet] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,485] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: vehiclePartLookup; operation: org.apache.axis2.description.OutInAxisOperation@dbe837named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}vehiclePartLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,500] – [DEBUG] – [mapActionToOperation: Mapping Action to Operation: action: urn:vehiclePartLookup; operation: org.apache.axis2.description.OutInAxisOperation@dbe837named: {http://webservices.amazon.com/AWSECommerceService/2009-07-01}vehiclePartLookup] – [AxisService.java:mapActionToOperation:788] –
    [2009-09-29 19:32:48,578] – [DEBUG] – [Adding service to allServices map: [AWSECommerceService1254249168250_1] ] – [AxisConfiguration.java:addToAllServicesMap:393] –
    [2009-09-29 19:32:48,781] – [DEBUG] – [Adding service to allEndpoints map: (AWSECommerceService1254249168250_1,AWSECommerceService1254249168250_1HttpSoap12Endpoint) ] – [AxisConfiguration.java:addServiceGroup:367] –
    [2009-09-29 19:32:48,781] – [DEBUG] – [Adding service to allEndpoints map: (AWSECommerceService1254249168250_1,AWSECommerceService1254249168250_1HttpSoap11Endpoint) ] – [AxisConfiguration.java:addServiceGroup:367] –
    [2009-09-29 19:32:48,781] – [DEBUG] – [Adding service to allEndpoints map: (AWSECommerceService1254249168250_1,AWSECommerceService1254249168250_1HttpEndpoint) ] – [AxisConfiguration.java:addServiceGroup:367] –
    [2009-09-29 19:32:48,781] – [DEBUG] – [After adding to allEndpoints map, size is 3] – [AxisConfiguration.java:addServiceGroup:374] –
    java.lang.IllegalArgumentException: Null InputStream is not a valid argument
    at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:614)
    at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:317)
    at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:79)
    amazon.AmazonProductSearch.(AmazonProductSearch.java:49)
    at .doProcess(MerchantAdminController.java:970)
    phase.getName() : Security
    phase.getName()::Dispatch
    inside handler
    inside handler
    inside handler
    inside handler
    inside handler
    [2009-09-29 19:34:21,922] – [DEBUG] – [Get operation for {http://webservices.amazon.com/AWSECommerceService/2009-07-01}itemLookup] – [AxisService.java:getOperation:1688] –
    [2009-09-29 19:34:21,922] – [DEBUG] – [Found axis operation: org.apache.axis2.description.OutInAxisOperation@16cdee6] – [AxisService.java:getOperation:1731] –
    [2009-09-29 19:34:22,110] – [DEBUG] – [registerOperationContext (false): org.apache.axis2.context.OperationContext@e1380f with key: urn:uuid:2FD43B7519755E52FE1254249262186] – [ConfigurationContext.java:registerOperationContext:332] –
    [2009-09-29 19:34:22,110] – [DEBUG] – [Entry: OutInAxisOperationClient::execute, true] – [OutInAxisOperation.java:executeImpl:168] –
    [2009-09-29 19:34:22,125] – [DEBUG] – [OutInAxisOperationClient: useAsyncOption null] – [OutInAxisOperation.java:executeImpl:198] –
    [2009-09-29 19:34:22,125] – [DEBUG] – [registerOperationContext (false): org.apache.axis2.context.OperationContext@e1380f with key: urn:uuid:2FD43B7519755E52FE1254249262186] – [ConfigurationContext.java:registerOperationContext:332] –
    [2009-09-29 19:34:22,141] – [DEBUG] – [msgContext: [MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] action: http://soap.amazon.com/ItemLookup – [ConfigurationContext.java:registerOperationContext:338] –
    [2009-09-29 19:34:22,141] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking pre-condition for Phase “OperationOutPhase”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:22,141] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking phase “OperationOutPhase”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:22,141] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking post-conditions for phase “OperationOutPhase”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:22,156] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking pre-condition for Phase “RMPhase”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:22,156] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking phase “RMPhase”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:22,156] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking post-conditions for phase “RMPhase”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:22,156] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking pre-condition for Phase “PolicyDetermination”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:22,156] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking phase “PolicyDetermination”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:22,172] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking post-conditions for phase “PolicyDetermination”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:22,172] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking pre-condition for Phase “MessageOut”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:22,172] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking phase “MessageOut”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:22,172] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking post-conditions for phase “MessageOut”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:22,172] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking pre-condition for Phase “Security”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:22,172] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking phase “Security”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:22,188] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Checking post-conditions for phase “Security”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:22,297] – [DEBUG] – [Set parameter http.useragent = Jakarta Commons-HttpClient/3.1] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,313] – [DEBUG] – [Set parameter http.protocol.version = HTTP/1.1] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,313] – [DEBUG] – [Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,328] – [DEBUG] – [Set parameter http.protocol.cookie-policy = default] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,328] – [DEBUG] – [Set parameter http.protocol.element-charset = US-ASCII] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,328] – [DEBUG] – [Set parameter http.protocol.content-charset = ISO-8859-1] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,344] – [DEBUG] – [Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@e4b8a] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,344] – [DEBUG] – [Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:22,360] – [DEBUG] – [Java version: 1.6.0_14] – [HttpClient.java::72] –
    [2009-09-29 19:34:22,360] – [DEBUG] – [Java vendor: Sun Microsystems Inc.] – [HttpClient.java::73] –
    [2009-09-29 19:34:22,375] – [DEBUG] – [Java class path: F:\Apps\ApacheSoftwareFoundation\Tomcat 5.5\bin\bootstrap.jar] – [HttpClient.java::74] –
    [2009-09-29 19:34:22,375] – [DEBUG] – [Operating system name: Windows XP] – [HttpClient.java::75] –
    [2009-09-29 19:34:22,375] – [DEBUG] – [Operating system architecture: x86] – [HttpClient.java::76] –
    [2009-09-29 19:34:22,375] – [DEBUG] – [Operating system version: 5.1] – [HttpClient.java::77] –
    [2009-09-29 19:34:23,688] – [DEBUG] – [SUN 1.6: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores, JavaPolicy Policy; JavaLoginConfig Configuration)] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,703] – [DEBUG] – [SunRsaSign 1.5: Sun RSA signature provider] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,703] – [DEBUG] – [SunJSSE 1.6: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,703] – [DEBUG] – [SunJCE 1.6: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,703] – [DEBUG] – [SunJGSS 1.0: Sun (Kerberos v5, SPNEGO)] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,719] – [DEBUG] – [SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,719] – [DEBUG] – [XMLDSig 1.0: XMLDSig (DOM XMLSignatureFactory; DOM KeyInfoFactory)] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,719] – [DEBUG] – [SunPCSC 1.6: Sun PC/SC provider] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,719] – [DEBUG] – [SunMSCAPI 1.6: Sun's Microsoft Crypto API provider] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,719] – [DEBUG] – [BC 1.43: BouncyCastle Security Provider v1.43] – [HttpClient.java::82] –
    [2009-09-29 19:34:23,750] – [DEBUG] – [Set parameter http.connection.timeout = 30000] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:23,750] – [DEBUG] – [Set parameter http.socket.timeout = 30000] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:23,750] – [DEBUG] – [Set parameter http.socket.timeout = 30000] – [DefaultHttpParams.java:setParameter:151] –
    [2009-09-29 19:34:23,797] – [DEBUG] – [Start getContentType: OMOutputFormat [ mimeBoundary =null rootContentId=null doOptimize=false doingSWA=false isSOAP11=true charSetEncoding=UTF-8 xmlVersion=null contentType=null ignoreXmlDeclaration=false autoCloseWriter=false actionProperty=null optimizedThreshold=0]] – [OMOutputFormat.java:getContentType:128] –
    [2009-09-29 19:34:23,797] – [DEBUG] – [getContentType= {text/xml} OMOutputFormat [ mimeBoundary =null rootContentId=null doOptimize=false doingSWA=false isSOAP11=true charSetEncoding=UTF-8 xmlVersion=null contentType=text/xml ignoreXmlDeclaration=false autoCloseWriter=false actionProperty=null optimizedThreshold=0]] – [OMOutputFormat.java:getContentType:154] –
    [2009-09-29 19:34:23,797] – [DEBUG] – [contentType from the OMOutputFormat =text/xml] – [SOAPMessageFormatter.java:getContentType:133] –
    [2009-09-29 19:34:23,797] – [DEBUG] – [contentType returned =text/xml; charset=UTF-8] – [SOAPMessageFormatter.java:getContentType:158] –
    [2009-09-29 19:34:23,875] – [DEBUG] – [HttpConnectionManager.getConnection: config = HostConfiguration[host=https://ecs.amazonaws.com], timeout = 0] – [MultiThreadedHttpConnectionManager.java:getConnectionWithTimeout:412] –
    [2009-09-29 19:34:23,891] – [DEBUG] – [Allocating new connection, hostConfig=HostConfiguration[host=https://ecs.amazonaws.com]] – [MultiThreadedHttpConnectionManager.java:createConnection:760] –
    [2009-09-29 19:34:23,906] – [DEBUG] – [Open connection to ecs.amazonaws.com:443] – [HttpConnection.java:open:692] –
    [2009-09-29 19:34:32,188] – [DEBUG] – [Start expire sessions StandardManager at 1254249272188 sessioncount 2] – [ManagerBase.java:processExpires:677] –
    [2009-09-29 19:34:32,203] – [DEBUG] – [End expire sessions StandardManager processingTime 15 expired sessions: 0] – [ManagerBase.java:processExpires:685] –
    [2009-09-29 19:34:43,531] – [DEBUG] – [>> "POST /onca/soap?Service=AWSECommerceService HTTP/1.1[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:43,547] – [DEBUG] – [Adding Host request header] – [HttpMethodBase.java:addHostRequestHeader:1352] –
    [2009-09-29 19:34:43,594] – [DEBUG] – [>> "Content-Type: text/xml; charset=UTF-8[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:43,594] – [DEBUG] – [>> "SOAPAction: "http://soap.amazon.com/ItemLookup"[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:43,594] – [DEBUG] – [>> "User-Agent: Axis2[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:43,610] – [DEBUG] – [>> "Host: ecs.amazonaws.com[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:43,610] – [DEBUG] – [>> "Transfer-Encoding: chunked[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:43,610] – [DEBUG] – [>> "[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:43,625] – [DEBUG] – [start writeTo()] – [SOAPMessageFormatter.java:writeTo:51] –
    [2009-09-29 19:34:43,625] – [DEBUG] – [ preserve=false] – [SOAPMessageFormatter.java:writeTo:52] –
    [2009-09-29 19:34:43,625] – [DEBUG] – [ isOptimized=false] – [SOAPMessageFormatter.java:writeTo:53] –
    [2009-09-29 19:34:43,625] – [DEBUG] – [ isDoingSWA=false] – [SOAPMessageFormatter.java:writeTo:54] –
    [2009-09-29 19:34:43,625] – [DEBUG] – [MTOM optimized Threshold value =0] – [Utils.java:getMtomThreshold:561] –
    [2009-09-29 19:34:43,641] – [DEBUG] – [OutputStream =class org.apache.commons.httpclient.ChunkedOutputStream] – [MTOMXMLStreamWriter.java::90] –
    [2009-09-29 19:34:43,641] – [DEBUG] – [OMFormat = OMOutputFormat [ mimeBoundary =null rootContentId=null doOptimize=false doingSWA=false isSOAP11=true charSetEncoding=UTF-8 xmlVersion=null contentType=text/xml ignoreXmlDeclaration=false autoCloseWriter=false actionProperty=null optimizedThreshold=0]] – [MTOMXMLStreamWriter.java::91] –
    [2009-09-29 19:34:43,656] – [DEBUG] – [About to create XMLOutputFactory implementation with classloader=WebappClassLoader
    delegate: false
    repositories:
    /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@7ff5b6
    ] – [StAXUtils.java:getXMLOutputFactory_perClassLoader:452] –
    [2009-09-29 19:34:43,656] – [DEBUG] – [The classloader for javax.xml.stream.XMLOutputFactory is: null] – [StAXUtils.java:getXMLOutputFactory_perClassLoader:454] –
    [2009-09-29 19:34:43,750] – [DEBUG] – [Created XMLOutputFactory = class com.ctc.wstx.stax.WstxOutputFactory for classloader=WebappClassLoader
    delegate: false
    repositories:
    /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@7ff5b6
    ] – [StAXUtils.java:getXMLOutputFactory_perClassLoader:500] –
    [2009-09-29 19:34:43,750] – [DEBUG] – [Size of XMLOutputFactory map =1] – [StAXUtils.java:getXMLOutputFactory_perClassLoader:502] –
    [2009-09-29 19:34:43,781] – [DEBUG] – [XMLStreamWriter is com.ctc.wstx.sw.SimpleNsStreamWriter] – [StAXUtils.java:createXMLStreamWriter:257] –
    [2009-09-29 19:34:43,797] – [DEBUG] – [serialize {http://webservices.amazon.com/AWSECommerceService/2009-07-01}ItemLookup to XMLStreamWriter] – [OMSourcedElementImpl.java:internalSerializeAndConsume:733] –
    [2009-09-29 19:34:43,797] – [DEBUG] – [Calling MTOMXMLStreamWriter.flush] – [MTOMXMLStreamWriter.java:flush:166] –
    [2009-09-29 19:34:44,344] – [DEBUG] – [Calling MTOMXMLStreamWriter.flush] – [MTOMXMLStreamWriter.java:flush:166] –
    [2009-09-29 19:34:44,344] – [DEBUG] – [end writeTo()] – [SOAPMessageFormatter.java:writeTo:86] –
    [2009-09-29 19:34:44,344] – [DEBUG] – [>> "29b[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,344] – [DEBUG] – [>> "[ACCESS_ID_I_REMOVED_ON_PURPOSE_HERE]AmazonB001AVOJ50ItemAttributesOfferFullImagesReviewsMedium”] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,360] – [DEBUG] – [>> "[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,360] – [DEBUG] – [>> "0"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,360] – [DEBUG] – [>> "[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,360] – [DEBUG] – [>> "[\r][\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,375] – [DEBUG] – [Request body sent] – [EntityEnclosingMethod.java:writeRequestBody:508] –
    [2009-09-29 19:34:44,578] – [DEBUG] – [<< "HTTP/1.1 400 Bad Request[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,578] – [DEBUG] – [<< "HTTP/1.1 400 Bad Request[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,594] – [DEBUG] – [<< "Date: Tue, 29 Sep 2009 18:34:45 GMT[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,594] – [DEBUG] – [<< "Server: Server[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,594] – [DEBUG] – [<< "Content-Type: text/xml;charset=UTF-8[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,625] – [DEBUG] – [<< "Vary: Accept-Encoding,User-Agent[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,625] – [DEBUG] – [<< "Cneonction: close[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,625] – [DEBUG] – [<< "Transfer-Encoding: chunked[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,625] – [DEBUG] – [<< "[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,641] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking flowComplete() in Phase "Security"] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,641] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking flowComplete() in Phase "MessageOut"] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,641] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking flowComplete() in Phase "PolicyDetermination"] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,641] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking flowComplete() in Phase "RMPhase"] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,641] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249262218] Invoking flowComplete() in Phase "OperationOutPhase"] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,656] – [DEBUG] – [createSOAPEnvelope using Builder (class org.apache.axis2.builder.SOAPBuilder) selected from type (text/xml)] – [TransportUtils.java:createDocumentElement:189] –
    [2009-09-29 19:34:44,672] – [DEBUG] – [<< "1"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,672] – [DEBUG] – [<< "f"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,672] – [DEBUG] – [<< "f"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,672] – [DEBUG] – [<< "[\r]"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,688] – [DEBUG] – [<< "[\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,688] – [DEBUG] – [<< "<?xm"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,688] – [DEBUG] – [char set encoding set from default =UTF-8] – [BuilderUtil.java:getCharSetEncoding:329] –
    [2009-09-29 19:34:44,703] – [DEBUG] – [<[\n]“] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,703] – [DEBUG] – [<< "aws:Client.MissingParameterThe request must contain the parameter Signature.38a88b24-c727-4eeb-9870-1dced34ba5fb"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,735] – [DEBUG] – [XMLStreamReader is com.ctc.wstx.sr.ValidatingStreamReader] – [StAXUtils.java:createXMLStreamReader:124] –
    [2009-09-29 19:34:44,750] – [DEBUG] – [Starting to process SOAP 1.1 message] – [StAXSOAPModelBuilder.java:constructNode:283] –
    [2009-09-29 19:34:44,750] – [DEBUG] – [Build the OMElement Envelope by the StaxSOAPModelBuilder] – [StAXSOAPModelBuilder.java:createOMElement:240] –
    [2009-09-29 19:34:44,766] – [DEBUG] – [Build the OMElement Body by the StaxSOAPModelBuilder] – [StAXSOAPModelBuilder.java:createOMElement:240] –
    [2009-09-29 19:34:44,766] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking pre-condition for Phase “Addressing”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:44,766] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking phase “Addressing”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:44,766] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking Handler ‘AddressingBasedDispatcher’ in Phase ‘Addressing’] – [Phase.java:invoke:315] –
    [2009-09-29 19:34:44,766] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking post-conditions for phase “Addressing”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:44,781] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking pre-condition for Phase “Security”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:44,781] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking phase “Security”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:44,781] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking post-conditions for phase “Security”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:44,781] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking pre-condition for Phase “PreDispatch”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:44,781] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking phase “PreDispatch”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:44,797] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking post-conditions for phase “PreDispatch”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:44,797] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking pre-condition for Phase “Dispatch”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:44,797] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking phase “Dispatch”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:44,797] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking Handler ‘RequestURIBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:invoke:315] –
    [2009-09-29 19:34:44,813] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking Handler ‘SOAPActionBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:invoke:315] –
    [2009-09-29 19:34:44,813] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking Handler ‘RequestURIOperationDispatcher’ in Phase ‘Dispatch’] – [Phase.java:invoke:315] –
    [2009-09-29 19:34:44,813] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking Handler ‘SOAPMessageBodyBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:invoke:315] –
    [2009-09-29 19:34:44,813] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking Handler ‘HTTPLocationBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:invoke:315] –
    [2009-09-29 19:34:44,813] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking post-conditions for phase “Dispatch”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:44,828] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking pre-condition for Phase “RMPhase”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:44,828] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking phase “RMPhase”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:44,828] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking post-conditions for phase “RMPhase”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:44,828] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking pre-condition for Phase “OperationInPhase”] – [Phase.java:invoke:293] –
    [2009-09-29 19:34:44,844] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking phase “OperationInPhase”] – [Phase.java:invoke:306] –
    [2009-09-29 19:34:44,844] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Checking post-conditions for phase “OperationInPhase”] – [Phase.java:invoke:329] –
    [2009-09-29 19:34:44,844] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() in Phase “OperationInPhase”] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,844] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() in Phase “RMPhase”] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,844] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() in Phase “Dispatch”] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,844] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() for Handler ‘HTTPLocationBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:flowComplete:359] –
    [2009-09-29 19:34:44,860] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() for Handler ‘SOAPMessageBodyBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:flowComplete:359] –
    [2009-09-29 19:34:44,860] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() for Handler ‘RequestURIOperationDispatcher’ in Phase ‘Dispatch’] – [Phase.java:flowComplete:359] –
    [2009-09-29 19:34:44,875] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() for Handler ‘SOAPActionBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:flowComplete:359] –
    [2009-09-29 19:34:44,875] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() for Handler ‘RequestURIBasedDispatcher’ in Phase ‘Dispatch’] – [Phase.java:flowComplete:359] –
    [2009-09-29 19:34:44,875] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() in Phase “PreDispatch”] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,875] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() in Phase “Security”] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,891] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() in Phase “Addressing”] – [Phase.java:flowComplete:340] –
    [2009-09-29 19:34:44,891] – [DEBUG] – [[MessageContext: logID=urn:uuid:2FD43B7519755E52FE1254249284844] Invoking flowComplete() for Handler ‘AddressingBasedDispatcher’ in Phase ‘Addressing’] – [Phase.java:flowComplete:359] –
    [2009-09-29 19:34:44,906] – [DEBUG] – [Build the OMElement Fault by the StaxSOAPModelBuilder] – [StAXSOAPModelBuilder.java:createOMElement:240] –
    [2009-09-29 19:34:44,906] – [DEBUG] – [Build the OMElement faultcode by the StaxSOAPModelBuilder] – [StAXSOAPModelBuilder.java:createOMElement:240] –
    [2009-09-29 19:34:44,922] – [DEBUG] – [Build the OMElement faultstring by the StaxSOAPModelBuilder] – [StAXSOAPModelBuilder.java:createOMElement:240] –
    [2009-09-29 19:34:44,938] – [DEBUG] – [Build the OMElement detail by the StaxSOAPModelBuilder] – [StAXSOAPModelBuilder.java:createOMElement:240] –
    [2009-09-29 19:34:44,938] – [DEBUG] – [Build the OMElement RequestId by the StaxSOAPModelBuilder] – [StAXSOAPModelBuilder.java:createOMElement:240] –
    [2009-09-29 19:34:44,938] – [DEBUG] – [<< "[\r]"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,953] – [DEBUG] – [<< "[\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,953] – [DEBUG] – [<< "0"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,953] – [DEBUG] – [<< "[\r]"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,953] – [DEBUG] – [<< "[\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,953] – [DEBUG] – [<< "[\r]"] – [Wire.java:wire:84] –
    [2009-09-29 19:34:44,969] – [DEBUG] – [<< "[\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,969] – [DEBUG] – [<< "[\r][\n]"] – [Wire.java:wire:70] –
    [2009-09-29 19:34:44,969] – [DEBUG] – [Resorting to protocol version default close connection policy] – [HttpMethodBase.java:shouldCloseConnection:1024] –
    [2009-09-29 19:34:44,969] – [DEBUG] – [Should NOT close connection, using HTTP/1.1] – [HttpMethodBase.java:shouldCloseConnection:1028] –
    [2009-09-29 19:34:44,969] – [DEBUG] – [Releasing connection back to connection manager.] – [HttpConnection.java:releaseConnection:1178] –
    [2009-09-29 19:34:44,985] – [DEBUG] – [Freeing connection, hostConfig=HostConfiguration[host=https://ecs.amazonaws.com]] – [MultiThreadedHttpConnectionManager.java:freeConnection:979] –
    [2009-09-29 19:34:44,985] – [DEBUG] – [Adding connection at: 1254249284985] – [IdleConnectionHandler.java:add:76] –
    [2009-09-29 19:34:44,985] – [DEBUG] – [Notifying no-one, there are no waiting threads] -

  22. pmularien says:

    Wow, that’s a long comment! ;)

    I think the issue is that it’s not finding your policy.xml file used to configure Axis 2. Note the following from your debug logging:

    [2009-09-29 19:32:48,781] – [DEBUG] – [After adding to allEndpoints map, size is 3] – [AxisConfiguration.java:addServiceGroup:374] –
    java.lang.IllegalArgumentException: Null InputStream is not a valid argument
    at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:614)
    at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:317)
    at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:79)
    amazon.AmazonProductSearch.(AmazonProductSearch.java:49)
    at .doProcess(MerchantAdminController.java:970)

    Make sure that policy.xml is available on your classpath – this ties back to the following line of code:
    InputStream resource = loader.getResourceAsStream("policy.xml");
    Hope that’s the issue! I’ll try to pull together a working ZIP file that people can download to start with.

  23. M.A.C says:

    my problem is in the following piece of code, what ever I do I can not find the Axis xml files
    and hence the code breaks

    if(loader.getResource(“client.axis2.xml”) == null)
    {
    System.err.println(“I can not find the client.axis2.xml in the class path”);
    }

    ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromURIs(loader.getResource(“client.axis2.xml”), null);
    client = new AWSECommerceServiceStub(ctx);
    Options options = client._getServiceClient().getOptions();
    client._getServiceClient().getOptions().setProperty(AddressingConstants.INCLUDE_OPTIONAL_HEADERS,Boolean.TRUE);

    if( loader.getResource(“policy.xml”) == null)
    {
    System.err.println(“I can not find the policy.xml in the classpath”);
    }

    tried to put these files in the WEB-INF, lib, local to the class in cases I can not get it
    to work.

    I look forward to your ZIP file. I would like to see it working in a simple batch or shell script.

    thanks for your support so far!

    MACintrosor

  24. M.A.C says:

    I have now progressed a bit further, I did put the axix/policy XML files you use in the classes
    directory under a new config and I load them successfully, this is a better way to avoid
    any doubt about the class path (see http://www.coderanch.com/t/384815/Java-General/java/classloader-getResource)

    I think now I have fundemental problems with the code, I still have not much luck in getting any
    response.

    I appreciate your input.

    here is my short INFO output

    [2009-10-01 15:31:08,856] – [INFO] – [No repository found , module will be loaded from classpath] – [URLBasedAxisConfigurator.java:getAxisConfiguration:70] –
    [2009-10-01 15:31:09,168] – [INFO] – [Deploying module: metadataExchange-1.5 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/mex-1.5.jar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,356] – [INFO] – [Deploying module: addressing-1.5 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/addressing-1.5.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,372] – [INFO] – [Deploying module: metadataExchange-1.5 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/mex-1.5.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,403] – [INFO] – [Deploying module: mtompolicy-1.5 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/mtompolicy-1.5.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,543] – [INFO] – [Deploying module: ping-1.5 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/ping-1.5.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,559] – [INFO] – [Deploying module: rahas-1.4 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/rahas-1.4.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,622] – [INFO] – [Deploying module: rampart-1.4 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/rampart-1.4.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,637] – [INFO] – [Deploying module: script-1.5 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/scripting-1.5.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,668] – [INFO] – [Deploying module: soapmonitor-1.5 - file:/F:/DevStore/myWorkSpaceAmazon/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/almazz/WEB-INF/lib/soapmonitor-1.5.mar] – [ModuleDeployer.java:deploy:75] –
    [2009-10-01 15:31:09,684] – [ERROR] – [AxisConfiguration getRepository returns null, cannot deploy scripts] – [ScriptModule.java:init:61] –
    I am able to get InputStream from resource policy.xml
    phase.getName() : Security
    phase.getName()::Dispatch
    inside handler
    inside handler
    inside handler
    inside handler
    inside handler
    org.apache.axis2.AxisFault: The request must contain the parameter Signature.
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:517)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at com.amazon.webservices.awsecommerceservice.AWSECommerceServiceStub.itemLookup(AWSECommerceServiceStub.java:1155)
    AmazonProductSearch.getAmazonInfo(AmazonProductSearch.java:146)

  25. Jakub Wach says:

    Thanks man. I’ve successfully adopted the solution to my application.

  26. M.A.C says:

    @Jakub

    no problem. Did you manage to get the whole example to work and retrieve some data from Amazon.
    would it be possible to share your experience, if have already resolved the problem with

    org.apache.axis2.AxisFault: The request must contain the parameter Signature.

    How did you fix this?

    Will you be able to email me (plive@gotadsl.co.uk) your sample application after stripping of course tour keys etc…

    much much appreciated.

    Mac…

    ps. @pmularien, are you able to email me your full example as you you promised.

  27. RiverDelta says:

    I m getting the same problem. First I get the error:
    java.lang.IllegalArgumentException: Null InputStream is not a valid argument
    and then
    org.apache.axis2.AxisFault: The request must contain the parameter Signature.
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:517)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

    I have set the xml files in the classpath.
    How to set the signature ??

    We are referring the following WSDL :
    http://ecs.amazonaws.com/AWSECommerceService/AWSECommerceService.wsdl

    Is there any other solution that I can implement ?

  28. RiverDelta says:

    We have also tried to access Amazon Web Service using following method:

    We have created Amazon client stub (jar), using it we try to send request to Amazon and get item list as response.

    We refer the guideline as given by Amazon. The link is: http://docs.amazonwebservices.com/AWSECommerceService//2009-10-01/GSG/

    We are getting following error:

    Exception in thread “main” com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 400: Bad Request
    at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.checkResponseCode(Unknown Source)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
    at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
    at $Proxy30.itemSearch(Unknown Source)
    at AmazonClient.main(AmazonClient.java:31)

    Anyone can please help us to solve this issue?

    Thanks in advance :)

  29. pmularien says:

    Based on the initial error you’re getting, it looks like you’re not picking up one (or both) of the policy.xml or client.axis2.xml files. These should be available on your classpath – if you’re building a web application, this would typically be in WEB-INF/classes.

    With regards to the second comment you posted, simply generating a client from the WSDL will not work anymore because signed requests are now required by Amazon. If you’re using the SOAP API, you must sign them using an approach similar to what I’ve described in this article.

  30. M.A.C says:

    @Mularien
    Writing this blog was a great help thank you. But leaving people struggling with your
    concept which left many people puzzled is not that helpful.

    Are you able to post the sample code for people to try out an download.

    Thanks for your feedback.

    Mac…

  31. hans says:

    Thanks for the tutorial!
    I’m a newbie and find several compiler errors. I would greatly appreciate if anyone can point out what is wrong. I believe I followed the steps and converted all codes into java files.

    ——————-
    init:
    deps-jar:
    Compiling 1 source file to D:\Keywords-trend\AWSNEW\build\classes
    D:\Keywords-trend\AWSNEW\src\com\mularien\amazon\PWCBHandler.java:17: cannot find symbol
    symbol : method getIdentifier()
    location: class org.apache.ws.security.WSPasswordCallback
    String id = pwcb.getIdentifier();
    1 error
    BUILD FAILED (total time: 7 seconds)
    ——————————

    ———————————–
    init:
    deps-jar:
    Compiling 1 source file to D:\Keywords-trend\AWSNEW\build\classes
    D:\Keywords-trend\AWSNEW\src\com\mularien\amazon\AmazonProductSearch.java:82: addItem(com.amazon.webservices.awsecommerceservice.types.Item_type3) in com.amazon.webservices.awsecommerceservice.types.Items_type0 cannot be applied to (com.amazon.webservices.awsecommerceservice.types.Item_type0)
    items.addItem(cartItem);
    ^
    D:\Keywords-trend\AWSNEW\src\com\mularien\amazon\AmazonProductSearch.java:83: setItems(com.amazon.webservices.awsecommerceservice.types.Items_type2) in com.amazon.webservices.awsecommerceservice.types.CartCreateRequest cannot be applied to (com.amazon.webservices.awsecommerceservice.types.Items_type0)
    cartCreateRequest.setItems(items);
    ^
    D:\Keywords-trend\AWSNEW\src\com\mularien\amazon\AmazonProductSearch.java:114: incompatible types
    found : com.amazon.webservices.awsecommerceservice.types.Items_type0
    required: com.amazon.webservices.awsecommerceservice.types.Items_type3
    for(Items_type3 items : response.getItemLookupResponse().getItems()) {
    ^
    D:\Keywords-trend\AWSNEW\src\com\mularien\amazon\AmazonProductSearch.java:115: cannot find symbol
    symbol : method getRequest()
    location: class com.amazon.webservices.awsecommerceservice.types.Items_type3
    Request_type0 request = items.getRequest();
    ^
    D:\Keywords-trend\AWSNEW\src\com\mularien\amazon\AmazonProductSearch.java:126: incompatible types
    found : com.amazon.webservices.awsecommerceservice.types.Item_type2
    required: com.amazon.webservices.awsecommerceservice.types.Item_type3
    return items.getItem()[0];
    ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    5 errors
    BUILD FAILED (total time: 6 seconds)
    ——————————-

  32. chuck says:

    First off… Thank you! I was able to get the examples working with very little modification.

    Now for the question: I’m new to axis2 and am getting this error when running the JUnit.

    ERROR - AxisConfiguration getRepository returns null, cannot deploy scripts

    I did the usual searching and nothing seems to work.

    The test is completing, I know this because i added some logging of info from amazon… but as you can see this is an error. Any ideas?

    TIA

  33. chuck says:

    As i dig deeper into the Amazon documentation I stumbled on a piece of sample code for preparing a REST request.
    http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/AuthJavaSampleSig2.html

    This works when tested in the environment setup above. The benefit is that execution times are FAST!. Here is the reported execution time:
    <RequestProcessingTime>0.0147520000000000</RequestProcessingTime>

    I have yet to select a simple way to process the requests since you don’t need the generated stubs for any of this.

    Ideas?

  34. Nerdy says:

    First of all, thank you so much Mularien for this post, it?s a treasure.
    I?ve gathered a list of corrections I?ve had to make to get the thing to work for me. There you have them for those to whom this might be of use:

    - In AmazonProductSearch?s constructor I have replaced
    ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromURIs
    (this.getClass().getResource(“client.axis2.xml”), null);
    by

    ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromURIs
    (this.getClass().getResource(“client.axis2.xml”),
    this.getClass().getResource(“/axis2-1.5/repository”));

    - The file /rampart1.4/rampart-1.4.mar has been dropped into /repository/modules.
    - I have edited the file /repository/modules/modules.list to add the entry rampart-1.4.mar.
    - I?ve had to rename the /types folder at the bottom of the hierarchy produced by wsdl2java as /_2009_11_01 to match the package name in the files? headers.

  35. az says:

    Mularien,
    First of all, thank you so much for this post!
    Amazon search works perfectly when I run my application from inside Eclipse.
    Unfortunately Maven can not process MAR-files and shows error message “Unable to obtain unarchiver for file …mar”.
    Does anybody know how to instruct Maven to process MAR-files ?

  36. Ramesh says:
  37. J.D. says:

    I kind of gave up on the idea of using SOAP after seeing this and a few other attempts to “solve” the issue of making the most simple of queries with AWS. Since this seems a bit more complicated than what I ended using, I’m going to share with you my solution :)

    I used REST and some other code to build the query and everything worked perfectly. I know this is not what everyone expects but it’s the only way I could make things work. In the Product Advertising API documentation there’s a little section that explains how to authenticate a request and it has a code sample for Java (that doesn’t work, needs to be tweaked). The sample helped me get started and the “Helper” (http://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html) got me where I wanted when I succesfully made the same URL that’s shown there. Hope this helps.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>