easysoa / EasySOA

A light, collaborative platform to make Service Oriented Architecture simple.
http://www.easysoa.org
35 stars 8 forks source link

Discovery monitoring proxy doesn't work with compressed responses #51

Closed JGuillemotte closed 12 years ago

JGuillemotte commented 12 years ago

To reproduce :

Start the discovery proxy with the test starter "ProxyStarter.java". Start the ui scaffolding proxy with the test starter "FormGeneratorMonitoredTester.java".

Open the page "Form_generator_links.html" (in the ui scaffolder proxy project => src/test/resources) in a web browser.

To have a not working example : Click on the link "FraSCAti Fibonnacci on Cloudbees", an html form is generated, enter 10 as parameter and click on the submit button. No response is displayed. This is because the distant service send back a compressed response. The monitoring proxy is not able to work with and send back to the client a String response ... and the client doesn't undestand ...

To have a working example : Click on the link "FraSCAti Fibonnacci on Amazon elasticbeanstalk", an html form is generated, enter 10 as parameter and click on the submit button. The response is displayed and is equals to 55.

Solution to solve this problem :

1 - Add a deflate/unzip feature to the proxy, this can be useful in the future to improve the service detection.

OR

2 - Send back the received response without to convert it in a String (change the BasicResponseHandler by an other handler)


Other problem is the timeout used int he discovery proxy, by default the timeout is set to 10sec. If the timeout is reached , two solutions :

  1. Send a clear timeout message to the client => a soap fault or a rest fault message.

or

  1. Do not use a timeout in the proxy ... Not a good solution because we can have the case where we never receive a response and we have to avoid to block the proxy.
JGuillemotte commented 12 years ago

Added a new response handler in discovery proxy. This reponse handler can deflate GZIP or ZIP compressed responses and returns a String. The proxy set (discovery proxy and ui scaffolder proxy) now works with web services returning compressed responses.

See com.openwide.easysoa.proxy.HttpResponseHandler in easysoa-proxy-core-httpdiscoveryproxy project.