You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by ali_khan <fa...@gmail.com> on 2008/01/02 10:11:09 UTC

Re: Amazon proxy unable to forward request to amazon search service

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


asankha wrote:
> 
> Ali
> 
> Will you be able to trace the call to Amazon through TCPMon and get me a
> trace of the reply.. also please post a successful request through
> TCPMon and let me know how the Amazon service replies on a success (i.e.
> a http 200 or 202 etc and any response if any)
> 
> asankha
> 
> ali_khan wrote:
>> hi,
>> below is my synapse.xml code:
>>
>> <definitions xmlns="http://ws.apache.org/ns/synapse"> 
>>  <proxy name="AmazonProxy"> 
>>         <target> 
>>             <endpoint> 
>>                 <address
>> uri="http://webservices.amazon.com/onca/xml?Service=AWSECommerceService"/> 
>>             </endpoint> 
>>         <outSequence> 
>>         <send/> 
>>         </outSequence> 
>>         </target> 
>>         <publishWSDL
>> uri="file:repository/conf/sample/resources/proxy/AWSECommerceService.wsdl"/> 
>>     </proxy> 
>>         <send/> 
>> </definitions> 
>>
>> and the following is the client code(segment):
>>
>>
>> String trpUrl = "http://localhost:8080/AmazonProxy"; 
>>  String addUrl =
>> "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService"; 
>>
>>  Options options = new Options(); 
>>  options.setTo(new EndpointReference(addUrl));           
>>  options.setProperty(Constants.Configuration.TRANSPORT_URL, trpUrl); 
>>
>>   OMElement result = serviceClient.sendReceive(payload); 
>>
>> where the payload is the following xml:
>>
>> <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> 
>>
>>
>> Also I have tested the service url i.e
>> "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService" on
>> web
>> browser by passing parameters as:
>>
>> http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
>>
>> When you put the above url in web browser it will give the response as
>> XML.
>> So I think the service URL is correct.
>>
>> Please suggest now
>>
>> thanks
>> faisal
>>
>>
>>
>>
>>
>> pzfreo wrote:
>>   
>>> Can you please post your client and synapse.xml?
>>>
>>> It looks like Amazon isn't liking the request it is sent by Synapse.
>>>
>>> Regards,
>>> Paul
>>>
>>> On Dec 31, 2007 5:04 AM, ali_khan <fa...@gmail.com> wrote:
>>>     
>>>> hi,
>>>>
>>>> I changed the service url to
>>>> "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService"
>>>> and
>>>> now
>>>> I am getting a different error which is:
>>>>
>>>> org.apache.axis2.AxisFault: The input stream for an incoming message is
>>>> null.
>>>>         at
>>>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:71)
>>>>         at
>>>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:326)
>>>>         at
>>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
>>>>         at
>>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>>>>         at
>>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>>>>         at
>>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
>>>>         at
>>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
>>>>         at
>>>> com.amazon.soap.StockClient.executeClient(StockClient.java:220)
>>>>         at com.amazon.soap.StockClient.main(StockClient.java:85)
>>>>
>>>> Can you please let me know what could be the reason for this error.
>>>>
>>>> Thanks
>>>> faisal
>>>>
>>>>
>>>>
>>>> asankha wrote:
>>>>       
>>>>> Hi Faisal
>>>>>         
>>>>>> Also I am sitting behind network proxy. Please suggest if this is the
>>>>>> root
>>>>>> of the problem. Where will I have to specify the network proxy
>>>>>>           
>>>> settings
>>>>       
>>>>>> to
>>>>>> get rid of this problem.
>>>>>>
>>>>>>           
>>>>> I will take a look at the root cause of the NPE next week.. for the
>>>>>         
>>>> time
>>>>       
>>>>> being, is there anyway you can allow direct access to the Amazon
>>>>>         
>>>> service
>>>>       
>>>>> from the node that runs Synapse?
>>>>>
>>>>> One more thing you could try is to follow this mail thread:
>>>>>
>>>>>         
>>>> http://www.mail-archive.com/httpcomponents-dev@jakarta.apache.org/msg02153.html
>>>>       
>>>>> and set a "Proxy-Connection" *transport* header to point to your proxy
>>>>> server.. If this fails, please raise a JIRA and we will address it as
>>>>> soon as we can
>>>>>
>>>>> asankha
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
>>>>> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>>>>>
>>>>>
>>>>>
>>>>>         
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14554376.html
>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>>
>>>> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
>>>> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>>>>
>>>>
>>>>       
>>>
>>> -- 
>>> Paul Fremantle
>>> Co-Founder and VP of Technical Sales, WSO2
>>> OASIS WS-RX TC Co-chair
>>>
>>> blog: http://pzf.fremantle.org
>>> paul@wso2.com
>>>
>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14575310.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Amazon proxy unable to forward request to amazon search service

Posted by Paul Fremantle <pz...@gmail.com>.
Ali

Synapse can also send REST requests. You need to switch back to the
REST URL and add the following format="pox"

 <address uri="http://localhost:9000/soap/SimpleStockQuoteService"
format="pox"/> into the address tag. Please see sample 152
http://ws.apache.org/synapse/Synapse_Samples.html#Sample152

Paul

On Jan 3, 2008 9:25 AM, ali_khan <fa...@gmail.com> wrote:
>
> hi,
> I think the problem is due to the firewall because when I put the following
> url(REST request) in web browser:
> http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
> I get proper result in the browser as an XML.
>
> But when I put the below URL(SOAP request):
>
> http://webservices.amazon.com/onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
>
> I get (HTTP 500 Internal Server Error)
>
> I think the soap requests are being blocked by proxy.
>
> Please suggest any solution for this, because rest I am doing the same as
> you mentioned.
>
> Thanks
> faisal
>
>
>
>
>
>
> asankha wrote:
> >
> > Faisal
> >> <P>Your cache administrator is  mailto:root root .
> >> ...
> >> Generated Wed, 02 Jan 2008 13:02:04 GMT by proxyserver.mycompany
> >> (squid/2.5.STABLE6)
> >>
> > Seems like your local cache/proxy server is having issues with the use
> > of TCPMon.. Usually a POST is of the form "POST /xxx HTTP/1.0" and the
> > /xxx is the relative URL of the requested resource. However if you
> > specify a TCPMon endpoint such as http://localhost:9090/xxx a proxy
> > server may sometimes try to use it and call on itself..
> >
> > please try the exact configuration I sent without using TCPMon and let
> > me know. Also use the utilities I pointed earlier to send the sample
> > request. Since that configuration works for me perfectly, you should be
> > able to get to this same point first and then try out variations
> >
> > Let me know how it goes..
> > asankha
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14594024.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>



-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Amazon proxy unable to forward request to amazon search service

Posted by "Asankha C. Perera" <as...@wso2.com>.
Faisal
> I am not able to access telnet service from my machine since it is not
> allowed. However our networking guys are able to connect to
> webservices.amazon.com from telnet (I will send this output to you soon ). 
>
> The following url also throws (HTTP 500 Internal Server Error) from our
> networking ppl browser.
> http://webservices.amazon.com/onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
>
> So in summary:
> 1. If I get telnet permission from Networking deptt, will it going to help
> me anyway?
>   
No.. it will only help identify what may be wrong with your environment,
access to Amazon or your proxy server
> 2. Has anybody ever accessed amazon service from synapse using soap?
>   
Yes! I was able to access Amazon over SOAP from behind a firewall as
well as over a direct ADSL connection from home for your exact example
you gave. So the problem you have seems to be on your side... I am just
trying to help you figure out what may be wrong in your network.. if a
basic tool such as telnet is restricted in your environment, I am just
guessing your firewalls may be blocking quite a few requests too :)
> 3. Should I try REST now, if yes then please also send the corresponding
> REST request XML.
>   
Both REST/SOAP (in your case) uses HTTP.. and I think the issue you have
currently is more on the network or http access. Can you try your
example from another network that has direct access? Maybe from home?

asankha

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Amazon proxy unable to forward request to amazon search service

Posted by ali_khan <fa...@gmail.com>.

Hi,

I am not able to access telnet service from my machine since it is not
allowed. However our networking guys are able to connect to
webservices.amazon.com from telnet (I will send this output to you soon ). 

The following url also throws (HTTP 500 Internal Server Error) from our
networking ppl browser.
http://webservices.amazon.com/onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611

So in summary:
1. If I get telnet permission from Networking deptt, will it going to help
me anyway?
2. Has anybody ever accessed amazon service from synapse using soap?
3. Should I try REST now, if yes then please also send the corresponding
REST request XML.

Thanks
faisal



asankha wrote:
> 
> Faisal
>> I get (HTTP 500 Internal Server Error)
>>
>> I think the soap requests are being blocked by proxy.
>>   
> I did the same from my office network (behind a proxy) over Firefox and
> got a blank page for
> 
> http://webservices.amazon.com/onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
> 
> When I manually telnet to Amazon I get the HTTP 500
> 
> asankha@asankha:~$ telnet webservices.amazon.com 80
> Trying 72.21.207.4...
> Connected to webservices.amazon.com.
> Escape character is '^]'.
> GET
> /onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
> HTTP/1.0
> 
> HTTP/1.0 500 Internal Server Error
> Date: Thu, 03 Jan 2008 09:43:29 GMT
> Server: Server
> x-amz-id-1: 16STA913H4W6234A8DA6
> x-amz-id-2: GqEdu9FIxEaGpTcMA3eIn6RVUrMbMV4rVfkaSfmEZg4=
> Cneonction: close
> Content-Type: text/html; charset=UTF-8
> *Vary: Accept-Encoding,User-Agent*
> Content-Length: 0
> Cneonction: close
> X-Cache: MISS from squid.lk.wso2.com
> X-Cache-Lookup: MISS from squid.lk.wso2.com:3128
> Via: 1.0 squid.lk.wso2.com:3128 (squid/2.6.STABLE13)
> Connection: close
> 
> Connection closed by foreign host.
> asankha@asankha:~$
> 
> But I don't think this is wrong.. as Amazon must be expecting a POST
> here.. the best I could try now is to ask you to manually try this from
> the command line (without Synapse) first.. See the text file I have
> attached for more details. First you should open a command line, and
> telnet to the amazon server. Then you copy line by line from the
> attached text file, and press enter on your telnet session. You repeat
> this for POST..., SOAPAction..., and Content-Length.. lines, and press
> enter twice. Then copy the text from <?xml version='... ....Envelope>
> and paste to the telnet session and press enter twice. You should get
> something like the following. You should now send this output to me :)
> 
> asankha
> 
> asankha@asankha:~$ telnet webservices.amazon.com 80
> Trying 72.21.207.4...
> Connected to webservices.amazon.com.
> Escape character is '^]'.
> POST /onca/soap?Service=AWSECommerceService HTTP/1.0
> SOAPAction: urn:ItemLookup
> Content-Length: 754
> 
> <?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>
> HTTP/1.0 200 OK
> Date: Thu, 03 Jan 2008 10:09:20 GMT
> Server: Server
> x-amz-id-1: 0GAN7BJ9SR24FTX0HG7E
> x-amz-id-2: Q3Yoq5UiMLMu8DurnJDykFv6Lk0x6qBN9VJd1orfd+c=
> nnCoection: close
> Content-Type: text/html; charset=UTF-8
> Vary: Accept-Encoding,User-Agent
> X-Cache: MISS from squid.lk.wso2.com
> X-Cache-Lookup: MISS from squid.lk.wso2.com:3128
> Via: 1.0 squid.lk.wso2.com:3128 (squid/2.6.STABLE13)
> Connection: close
> 
> <?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"></Header></HTTPHeaders><RequestId>0GAN7BJ9SR24FTX0HG7E</RequestId><Arguments><Argument
> Name="Service"
> Value="AWSECommerceService"></Argument></Arguments><RequestProcessingTime>0.0152559280395508</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>Connection
> closed by foreign host.
> asankha@asankha:~$
> 
> telnet webservices.amazon.com 80
> 
> POST /onca/soap?Service=AWSECommerceService HTTP/1.0
> SOAPAction: urn:ItemLookup
> Content-Length: 754
> 
> <?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>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> 

-- 
View this message in context: http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14618823.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Amazon proxy unable to forward request to amazon search service

Posted by "Asankha C. Perera" <as...@wso2.com>.
Faisal
> I get (HTTP 500 Internal Server Error)
>
> I think the soap requests are being blocked by proxy.
>   
I did the same from my office network (behind a proxy) over Firefox and
got a blank page for

http://webservices.amazon.com/onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611

When I manually telnet to Amazon I get the HTTP 500

asankha@asankha:~$ telnet webservices.amazon.com 80
Trying 72.21.207.4...
Connected to webservices.amazon.com.
Escape character is '^]'.
GET
/onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
HTTP/1.0

HTTP/1.0 500 Internal Server Error
Date: Thu, 03 Jan 2008 09:43:29 GMT
Server: Server
x-amz-id-1: 16STA913H4W6234A8DA6
x-amz-id-2: GqEdu9FIxEaGpTcMA3eIn6RVUrMbMV4rVfkaSfmEZg4=
Cneonction: close
Content-Type: text/html; charset=UTF-8
*Vary: Accept-Encoding,User-Agent*
Content-Length: 0
Cneonction: close
X-Cache: MISS from squid.lk.wso2.com
X-Cache-Lookup: MISS from squid.lk.wso2.com:3128
Via: 1.0 squid.lk.wso2.com:3128 (squid/2.6.STABLE13)
Connection: close

Connection closed by foreign host.
asankha@asankha:~$

But I don't think this is wrong.. as Amazon must be expecting a POST
here.. the best I could try now is to ask you to manually try this from
the command line (without Synapse) first.. See the text file I have
attached for more details. First you should open a command line, and
telnet to the amazon server. Then you copy line by line from the
attached text file, and press enter on your telnet session. You repeat
this for POST..., SOAPAction..., and Content-Length.. lines, and press
enter twice. Then copy the text from <?xml version='... ....Envelope>
and paste to the telnet session and press enter twice. You should get
something like the following. You should now send this output to me :)

asankha

asankha@asankha:~$ telnet webservices.amazon.com 80
Trying 72.21.207.4...
Connected to webservices.amazon.com.
Escape character is '^]'.
POST /onca/soap?Service=AWSECommerceService HTTP/1.0
SOAPAction: urn:ItemLookup
Content-Length: 754

<?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>
HTTP/1.0 200 OK
Date: Thu, 03 Jan 2008 10:09:20 GMT
Server: Server
x-amz-id-1: 0GAN7BJ9SR24FTX0HG7E
x-amz-id-2: Q3Yoq5UiMLMu8DurnJDykFv6Lk0x6qBN9VJd1orfd+c=
nnCoection: close
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding,User-Agent
X-Cache: MISS from squid.lk.wso2.com
X-Cache-Lookup: MISS from squid.lk.wso2.com:3128
Via: 1.0 squid.lk.wso2.com:3128 (squid/2.6.STABLE13)
Connection: close

<?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"></Header></HTTPHeaders><RequestId>0GAN7BJ9SR24FTX0HG7E</RequestId><Arguments><Argument
Name="Service"
Value="AWSECommerceService"></Argument></Arguments><RequestProcessingTime>0.0152559280395508</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>Connection
closed by foreign host.
asankha@asankha:~$

Re: Amazon proxy unable to forward request to amazon search service

Posted by ali_khan <fa...@gmail.com>.
hi,
I think the problem is due to the firewall because when I put the following
url(REST request) in web browser:
http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
I get proper result in the browser as an XML.

But when I put the below URL(SOAP request):

http://webservices.amazon.com/onca/soap?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611

I get (HTTP 500 Internal Server Error)

I think the soap requests are being blocked by proxy.

Please suggest any solution for this, because rest I am doing the same as
you mentioned.

Thanks
faisal





asankha wrote:
> 
> Faisal
>> <P>Your cache administrator is  mailto:root root . 
>> ...
>> Generated Wed, 02 Jan 2008 13:02:04 GMT by proxyserver.mycompany
>> (squid/2.5.STABLE6)
>>   
> Seems like your local cache/proxy server is having issues with the use
> of TCPMon.. Usually a POST is of the form "POST /xxx HTTP/1.0" and the
> /xxx is the relative URL of the requested resource. However if you
> specify a TCPMon endpoint such as http://localhost:9090/xxx a proxy
> server may sometimes try to use it and call on itself..
> 
> please try the exact configuration I sent without using TCPMon and let
> me know. Also use the utilities I pointed earlier to send the sample
> request. Since that configuration works for me perfectly, you should be
> able to get to this same point first and then try out variations
> 
> Let me know how it goes..
> asankha
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14594024.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Amazon proxy unable to forward request to amazon search service

Posted by "Asankha C. Perera" <as...@wso2.com>.
Faisal
> <P>Your cache administrator is  mailto:root root . 
> ...
> Generated Wed, 02 Jan 2008 13:02:04 GMT by proxyserver.mycompany
> (squid/2.5.STABLE6)
>   
Seems like your local cache/proxy server is having issues with the use
of TCPMon.. Usually a POST is of the form "POST /xxx HTTP/1.0" and the
/xxx is the relative URL of the requested resource. However if you
specify a TCPMon endpoint such as http://localhost:9090/xxx a proxy
server may sometimes try to use it and call on itself..

please try the exact configuration I sent without using TCPMon and let
me know. Also use the utilities I pointed earlier to send the sample
request. Since that configuration works for me perfectly, you should be
able to get to this same point first and then try out variations

Let me know how it goes..
asankha

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Amazon proxy unable to forward request to amazon search service

Posted by ali_khan <fa...@gmail.com>.
hi,
I did as you explained but below is the request and response I got in
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/soap?Service=AWSECommerceService&amp;AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02</wsa:To><wsa:MessageID>urn:uuid:88219F390892EA04DB1199279283168</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: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:
/soap/AmazonProxy /soap/AmazonProxy 
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Invalid URL
</STRONG>
</UL>

<P>
Some aspect of the requested URL is incorrect.  Possible problems:
<UL>
<LI>Missing or incorrect access protocol (should be `http://'' or similar)
<LI>Missing hostname
<LI>Illegal double-escape in the URL-Path
<LI>Illegal character in hostname; underscores are not allowed
</UL>
<P>Your cache administrator is  mailto:root root . 

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Wed, 02 Jan 2008 13:02:04 GMT by proxyserver.mycompany
(squid/2.5.STABLE6)
</ADDRESS>
</BODY></HTML>

Please let me know what I should enter as Local Monitoring port, host name
and port in the TCPMon configuration.May be that is creating the error.
Presently I have entered Host name same as my proxy host, and port as my
proxy port.

Please suggest.

thanks
faisal






asankha wrote:
> 
> 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:
> asankha@asankha:~/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:
> 
> asankha@asankha:~/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
>>
>>   
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14578314.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Amazon proxy unable to forward request to amazon search service

Posted by "Asankha C. Perera" <as...@wso2.com>.
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:
asankha@asankha:~/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:

asankha@asankha:~/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
>
>   
>

Re: Amazon proxy unable to forward request to amazon search service

Posted by Paul Fremantle <pz...@gmail.com>.
Have you got a successful trace that goes direct (that is - NOT going
through Synapse?)

Paul

On Jan 2, 2008 9:11 AM, ali_khan <fa...@gmail.com> 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
>
>
>
> asankha wrote:
> >
> > Ali
> >
> > Will you be able to trace the call to Amazon through TCPMon and get me a
> > trace of the reply.. also please post a successful request through
> > TCPMon and let me know how the Amazon service replies on a success (i.e.
> > a http 200 or 202 etc and any response if any)
> >
> > asankha
> >
> > ali_khan wrote:
> >> hi,
> >> below is my synapse.xml code:
> >>
> >> <definitions xmlns="http://ws.apache.org/ns/synapse">
> >>  <proxy name="AmazonProxy">
> >>         <target>
> >>             <endpoint>
> >>                 <address
> >> uri="http://webservices.amazon.com/onca/xml?Service=AWSECommerceService"/>
> >>             </endpoint>
> >>         <outSequence>
> >>         <send/>
> >>         </outSequence>
> >>         </target>
> >>         <publishWSDL
> >> uri="file:repository/conf/sample/resources/proxy/AWSECommerceService.wsdl"/>
> >>     </proxy>
> >>         <send/>
> >> </definitions>
> >>
> >> and the following is the client code(segment):
> >>
> >>
> >> String trpUrl = "http://localhost:8080/AmazonProxy";
> >>  String addUrl =
> >> "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService";
> >>
> >>  Options options = new Options();
> >>  options.setTo(new EndpointReference(addUrl));
> >>  options.setProperty(Constants.Configuration.TRANSPORT_URL, trpUrl);
> >>
> >>   OMElement result = serviceClient.sendReceive(payload);
> >>
> >> where the payload is the following xml:
> >>
> >> <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>
> >>
> >>
> >> Also I have tested the service url i.e
> >> "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService" on
> >> web
> >> browser by passing parameters as:
> >>
> >> http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=0GGBQRMT1MHNNDN5BY02&Operation=ItemLookup&IdType=ASIN&ItemId=0706922611
> >>
> >> When you put the above url in web browser it will give the response as
> >> XML.
> >> So I think the service URL is correct.
> >>
> >> Please suggest now
> >>
> >> thanks
> >> faisal
> >>
> >>
> >>
> >>
> >>
> >> pzfreo wrote:
> >>
> >>> Can you please post your client and synapse.xml?
> >>>
> >>> It looks like Amazon isn't liking the request it is sent by Synapse.
> >>>
> >>> Regards,
> >>> Paul
> >>>
> >>> On Dec 31, 2007 5:04 AM, ali_khan <fa...@gmail.com> wrote:
> >>>
> >>>> hi,
> >>>>
> >>>> I changed the service url to
> >>>> "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService"
> >>>> and
> >>>> now
> >>>> I am getting a different error which is:
> >>>>
> >>>> org.apache.axis2.AxisFault: The input stream for an incoming message is
> >>>> null.
> >>>>         at
> >>>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:71)
> >>>>         at
> >>>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:326)
> >>>>         at
> >>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> >>>>         at
> >>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> >>>>         at
> >>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> >>>>         at
> >>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
> >>>>         at
> >>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
> >>>>         at
> >>>> com.amazon.soap.StockClient.executeClient(StockClient.java:220)
> >>>>         at com.amazon.soap.StockClient.main(StockClient.java:85)
> >>>>
> >>>> Can you please let me know what could be the reason for this error.
> >>>>
> >>>> Thanks
> >>>> faisal
> >>>>
> >>>>
> >>>>
> >>>> asankha wrote:
> >>>>
> >>>>> Hi Faisal
> >>>>>
> >>>>>> Also I am sitting behind network proxy. Please suggest if this is the
> >>>>>> root
> >>>>>> of the problem. Where will I have to specify the network proxy
> >>>>>>
> >>>> settings
> >>>>
> >>>>>> to
> >>>>>> get rid of this problem.
> >>>>>>
> >>>>>>
> >>>>> I will take a look at the root cause of the NPE next week.. for the
> >>>>>
> >>>> time
> >>>>
> >>>>> being, is there anyway you can allow direct access to the Amazon
> >>>>>
> >>>> service
> >>>>
> >>>>> from the node that runs Synapse?
> >>>>>
> >>>>> One more thing you could try is to follow this mail thread:
> >>>>>
> >>>>>
> >>>> http://www.mail-archive.com/httpcomponents-dev@jakarta.apache.org/msg02153.html
> >>>>
> >>>>> and set a "Proxy-Connection" *transport* header to point to your proxy
> >>>>> server.. If this fails, please raise a JIRA and we will address it as
> >>>>> soon as we can
> >>>>>
> >>>>> asankha
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> >>>>> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>> --
> >>>> View this message in context:
> >>>> http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14554376.html
> >>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>>
> >>>> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> >>>> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >>>>
> >>>>
> >>>>
> >>>
> >>> --
> >>> Paul Fremantle
> >>> Co-Founder and VP of Technical Sales, WSO2
> >>> OASIS WS-RX TC Co-chair
> >>>
> >>> blog: http://pzf.fremantle.org
> >>> paul@wso2.com
> >>>
> >>> "Oxygenating the Web Service Platform", www.wso2.com
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> >>> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Amazon-proxy-unable-to-forward-request-to-amazon-search-service-tp14526765p14575310.html
>
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>



-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org