Question

I am new to Mule ESB and today I have some experiences with pattern configuration. And I still don't know what is the difference between pattern:web-service-proxy and pattern :http-proxy. Because,I only see that both of these pattern could redirect inbound-address to outbound-address. And one more problem, this config could run well, I could jump to soap web service

<pattern:http-proxy name="http-proxy-sample-2">
    <http:inbound-endpoint address="http://localhost:9001/pattern/httpproxy2" />
    <http:outbound-endpoint address="http://localhost:9000/services/soap" />
</pattern:http-proxy>

However, I'm unable to run this:

<pattern:http-proxy name="http-proxy-sample-2">
    <http:inbound-endpoint address="http://localhost:9001/pattern/httpproxy2" />
    <http:outbound-endpoint address="http://google.com" />
</pattern:http-proxy>

Maybe I have misunderstood here, someone please give me some advises.

Was it helpful?

Solution

Though they both serve a similar purpose at core (proxy HTTP requests) these two patterns are very different:

  • pattern:web-service-proxy is focused on proxying SOAP-style HTTP requests and as such supports auto-rewriting remote WSDLs so their service address uses the proxy address. It is mainly designed to support GET for WSDL requests (detected if the inbound path ends with ?wsdl) and POST for SOAP requests.
  • http-proxy is focused on generic HTTP requests proxying. It doesn't recognize WSDL requests but it is able to forward inbound headers and paths to the remote address. For example if the proxy listens on /proxy calling it with /proxy/users/1 will append /users/1 to the configured outbound path.

Now why does your second http-proxy fails? No idea: you need to provide more information about the issue you are experiencing with it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top