8 Replies Latest reply on Jul 11, 2009 9:59 AM by Rune Molin

    Loosing response headers

    Rune Molin Newbie

      Hi,

      I'm trying to proxy a webservice, like this:

       <providers>
       <http-provider name="HTTP" host="localhost" port="8765">
       <http-bus busid="HTTP-2" context="/Security/Unsecured" />
       </http-provider>
      
       </providers>
      
       <services>
       <service category="Security" name="Unsecured" description="not secured test service"
       invmScope="GLOBAL">
      
       <listeners>
       <http-listener name="HTTP-Gateway" busidref="HTTP-2"
       maxThreads="10" is-gateway="true">
       </http-listener>
      
       </listeners>
      
       <actions mep="RequestResponse">
      
       <action name="convert" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
      
       <action name="router"
       class="org.jboss.soa.esb.actions.routing.http.HttpRouter">
       <property name="endpointUrl" value="http://10.111.30.120:8080/DemoService" />
       <property name="method" value="POST" />
       </action>
      
       </actions>
       </service>
       </services>
      
      


      It works nicely - almost! The problem is that the response headers are lost along the way - specifically the content type header, which prevents my consumer from getting a correct response.

      I think I have narrowed the problem down to the fact that the HttpRouter class places headers in the message body (in the method attachResponseDetails), but HttpMessageComposer expects the headers to be in the message properties (see HttpMessageComposer#decompose).

      Can anybody confirm this problem, and is there a good work-around ? I suppose I could write some correction action and insert at the bottom of the action pipeline

      /Rune