Announcement Announcement Module
Collapse
No announcement yet.
Spring HTTP Invoker and HTTP Forwarding Proxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring HTTP Invoker and HTTP Forwarding Proxy

    Hi,

    I am designing a thick client application that needs to do some simple remoting against a spring-enabled web application. One of the requirements for the client is to support forwarding proxies (similar to how one sets up Internet Explorer). I would like to use Spring's HTTP invoker but I am unclear if this protocol will cause problems with real-world HTTP proxies. My understanding is that these HTTP proxies generally have issues when the body of the HTTP request is not used in the way that they expect (param1=value1&param2=value2).

    In looking at the HTTP request that comes from the HTTP invoker I can see that Spring, is in fact, putting the spring-specific invocation as part of the body.

    Does anyone have any real-world cases of using the HTTP invoker with forwarding proxies?

    Thanks very much!

  • #2
    I've been using HTTP based remoting for a number of years and have never experienced any problems with proxies.

    All requests generated by the HTTP invoker are of type POST which means that any proxy must be passed through to the source server and also that the result will not be cached. I suspect the issues you've heard about are related to GET requests.

    HTH

    Comment


    • #3
      Thanks for the reply. Actually, I was referring specifically to POST. Even the Google API FAQ mentions that proxies may have issues with SOAP requests. http://www.google.com/apis/api_faq.html#tech9

      A SOAP request can be a POST/GET request and according to them proxies aren't 100% compatible. Ideas why?

      Comment


      • #4
        I'm unaware of these issues and like I said I've never experienced any issues (all of our remoting requests go through at least 2 proxies).

        Basically, if a proxy caches a POST request it is seriously broken but that's not to say that they don't.... If you were to encounter a proxy that is doing this it would be trivial to hack HttpInvokerProxyFactoryBean so that it generated uncacheable requests:

        Code:
        public class UncacheableHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryBean {
        
            private static long requestCounter;	
        
            /**
             * Return a unique URL for every request
             */		
            public String getServiceUrl() {
                return super.getServiceUrl() + '?' + (requestCounter++)
            }
        }

        Comment

        Working...
        X