Ali / Faisal

First of all, it seems like you are trying out the Amazon REST service
endpoint with a SOAP request!

Instead try the endpoint address :
"http://webservices.amazon.com/onca/*soap*?Service=AWSECommerceService";
(Reference http://weblog.plexobject.com/?p=1555)

I tried this with a simple configuration as follows:
<definitions xmlns="http://ws.apache.org/ns/synapse";>
    <proxy name="AmazonProxy">
        <target>
            <inSequence>
*                <property name="FORCE_HTTP_1.0" value="true"
scope="axis2-client" /> *
            </inSequence>             
            <endpoint>
                <address
uri="http://webservices.amazon.com/onca/soap?Service=AWSECommerceService"/>
            </endpoint>
            <outSequence>
                <log level="full"/>
                <send/>
            </outSequence>
        </target>
    </proxy>
    <send/>
</definitions> 

Note that I have had to force the use of HTTP 1.0 protocol (though its
not as good as HTTP 1.1) as Amazon didn't accept HTTP 1.1..

To send a sample request I did the following, however I assume you
already have the required client and thus can skip this step..
I saved the sample request you gave me to a file, and used the following
tool to send this sample request to Synapse as follows:
[EMAIL PROTECTED]:~/perf$ *java -jar benchmark.jar -p amazon.xml -n 1 -c 1
-k -H "SOAPAction: urn:ItemLookup" -T "text/xml; charset=UTF-8"
http://localhost:8080/soap/AmazonProxy *(Reference :
http://wso2.org/node/1721)

I got the successful response without any issues.. let me know if this
works for you now
asankha

PS: Contents of the request file were as follows:

[EMAIL PROTECTED]:~/perf$ cat amazon.xml
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:wsa="http://www.w3.org/2005/08/addressing";><soapenv:Header><wsa:To>http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&amp;AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02</wsa:To><wsa:MessageID>urn:uuid:74CDA5F8B64F745F3A1199264726665</wsa:MessageID><wsa:Action>urn:ItemLookup</wsa:Action></soapenv:Header><soapenv:Body><m:ItemLookup
xmlns:m="http://webservices.amazon.com/AWSECommerceService/2005-03-23";><m:Request><m:ContentType>text/html</m:ContentType><m:IdType>ASIN</m:IdType><m:ItemId>0706922611</m:ItemId><m:SubscriptionId>0525E2PQ81DD7ZTWTK82</m:SubscriptionId></m:Request></m:ItemLookup></soapenv:Body></soapenv:Envelope>

The response I got was the following:
2008-01-02 15:59:41,481 [127.0.1.1-asankha] [HttpClientWorker-1]  INFO
LogMediator To: http://www.w3.org/2005/08/addressing/anonymous,
MessageID: urn:uuid:1F6BFC9306E185F4511199269780241016001-2022702338,
Direction: response, Envelope: <?xml version='1.0'
encoding='utf-8'?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";><SOAP-ENV:Body><ItemLookupResponse
xmlns="http://webservices.amazon.com/AWSECommerceService/2005-03-23";><OperationRequest><HTTPHeaders><Header
Name="UserAgent" Value="Synapse-HttpComponents-NIO"
/></HTTPHeaders><RequestId>09N82ZJ3SSTGK52JQZ0N</RequestId><Arguments><Argument
Name="Service" Value="AWSECommerceService"
/></Arguments><RequestProcessingTime>0.012732982635498</RequestProcessingTime></OperationRequest><Items><Request><IsValid>True</IsValid><ItemLookupRequest><IdType>ASIN</IdType><ItemId>0706922611</ItemId></ItemLookupRequest></Request><Item><ASIN>0706922611</ASIN><DetailPageURL>http://www.amazon.com/gp/redirect.html%3FASIN=0706922611%26tag=ws%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/0706922611%253FSubscriptionId=0525E2PQ81DD7ZTWTK82</DetailPageURL><ItemAttributes><Author>Arun
Shourie</Author><Manufacturer>Vikas</Manufacturer><ProductGroup>Book</ProductGroup><Title>Mrs
Gandhi's second
reign</Title></ItemAttributes></Item></Items></ItemLookupResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

ali_khan wrote:
> hi,
>
> below is the request and response trace through TCPMon:
>
> Request:
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:wsa="http://www.w3.org/2005/08/addressing";><soapenv:Header><wsa:To>http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&amp;AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02</wsa:To><wsa:MessageID>urn:uuid:74CDA5F8B64F745F3A1199264726665</wsa:MessageID><wsa:Action>urn:ItemLookup</wsa:Action></soapenv:Header><soapenv:Body><m:ItemLookup
> xmlns:m="http://webservices.amazon.com/AWSECommerceService/2005-03-23";><m:Request><m:ContentType>text/html</m:ContentType><m:IdType>ASIN</m:IdType><m:ItemId>0706922611</m:ItemId><m:SubscriptionId>0525E2PQ81DD7ZTWTK82</m:SubscriptionId></m:Request></m:ItemLookup></soapenv:Body></soapenv:Envelope>
>
>
> Response:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd";>
> <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html;
> charset=iso-8859-1">
> <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
> <STYLE
> type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
> </HEAD><BODY>
> <H1>ERROR</H1>
> <H2>The requested URL could not be retrieved</H2>
> <HR noshade size="1px">
> <P>
> While trying to retrieve the URL:
> /AmazonProxy /AmazonProxy 
> <P>
> The following error was encountered:
> <UL>
> <LI>
> <STRONG>
> Invalid URL
> </STRONG>
> </UL>
> I am not able to test for any successful condition.
>
>
> faisal
>
>   
>

Reply via email to