title: Secured HTTP Proxy over different ESB Products
body: <p>Im currently evaluating different ESB Products (in fact im focuding on mule right now). The Use Case is to proxy a simple HTTP Service, an OpenGIS Web Mapping Service WMS. </p>
  
  <p>Here is an example of an freely published WMS Service:</p>
  
  <ul>
  <li>it responds with XML Metadata about the Service for a "GetCapablities" Request (http://www.wms.nrw.de/wms/uebersicht_nrw2?REQUEST=GetCapabilities&amp;VERSION=1.1.1&amp;SERVICE=WMS)</li>
  <li>it responds with Image data containing a map for a "GetMap" Request (http://www.wms.nrw.de/wms/uebersicht_nrw2?REQUEST=GetMap&amp;VERSION=1.1.1&amp;SERVICE=WMS&amp;LAYERS=Uebersicht&amp;SRS=EPSG:31466&amp;FORMAT=image/png&amp;BBOX=2538900,5656400,2619500,5777000&amp;WIDTH=200&amp;HEIGHT=200&amp;STYLES=&amp;)</li>
  </ul>
  
  <p>Both returns its data as a byte array, which could possibly be the problem i am dealing with. </p>
  
  <p>After I can proxy it through Mule ESB, I want to add security features as follows:</p>
  
  <ul>
  <li>HTTP Basic and Digest Authentication </li>
  <li>Authentication via TLS Client certificates</li>
  <li>Implementing a XACML Policy Enforcement Point </li>
  <li>provide some usage statistics over auditing services and implement some QoS and Throttling on it.</li>
  </ul>
  
  <p>But basically the proxy itself isn't working as i want it to. Here is what I got so far. First I tried to proxy it with a flow to add a security provider on the inbound-adress. but the request doesn't seem to get through to the outbound-adress, and the response is empty.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security" xmlns:ss="http://www.springframework.org/schema/security" version="CE-3.2.1" xsi:schemaLocation="...cut..."
  &lt;mule-ss:security-manager&gt;  
      &lt;mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager"/&gt; 
  &lt;/mule-ss:security-manager&gt;
  &lt;spring:beans&gt;
      &lt;ss:authentication-manager alias="authenticationManager"&gt;  
          &lt;ss:authentication-provider&gt; 
              &lt;ss:user-service id="userService"&gt; 
                  &lt;ss:user name="ross" password="ross" authorities="ROLE_ADMIN"/&gt;  
                  &lt;ss:user name="anon" password="anon" authorities="ROLE_ANON"/&gt; 
              &lt;/ss:user-service&gt; 
          &lt;/ss:authentication-provider&gt; 
      &lt;/ss:authentication-manager&gt;
  &lt;/spring:beans&gt;
  &lt;http:connector name="NoSessionConnector"&gt;
      &lt;service-overrides sessionHandler="org.mule.session.NullSessionHandler" /&gt;
  &lt;/http:connector&gt;
  &lt;flow name="wfsFlow1" doc:name="wfsFlow1" processingStrategy="synchronous"&gt;
      &lt;http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="wms" responseTimeout="10000000" doc:name="Geoserver OWS"&gt;
          &lt;mule-ss:http-security-filter realm="mule-realm"/&gt;
      &lt;/http:inbound-endpoint&gt;
      &lt;http:outbound-endpoint exchange-pattern="request-response" method="GET" address="http://www.wms.nrw.de/wms#[header:INBOUND:http.request]" encoding="UTF-8" disableTransportTransformer="true" responseTimeout="1000000" doc:name="Geoserver OWS"/&gt;
  &lt;/flow&gt;
  &lt;/mule&gt;
  </code></pre>
  
  <p>I think the problem is the response from the WMS Service as byte array. I tried different repsonse transformers to transform from byte array to string or html response, but it didn't work.</p>
  
  <p>I also tried the bridge pattern, but it wasn't providing the parameters with the GET Operation as i expected but by POST, which is not accepted by the underlying WMS Service.</p>
  
  <p>I think my Use Case is pretty simple, but im trying to implement it since four weeks now. I did every sample Tutorial these vendors provided, but i wasn't able to set up a simple HTTP Parameter service with any kind of authentication.</p>
  
  <p>Does anybody have any experiences with these products or would beso nice to answer me some specific questions on how to set up a HTTP Proxy with authentication on any of these products.</p>
  
  <p>Many thanks!</p>