1 2 3 4 5 6 Previous Next 79 Replies Latest reply on Sep 14, 2009 4:33 AM by Tom Fennelly Go to original post
      • 75. Re: Http Gateway - requirements please...
        Tom Fennelly Master

        Oh sorry.... I should have added there that this new element will replace the originally proposed "sync" attribute.

        • 76. Re: Http Gateway - requirements please...
          Scott Dawson Apprentice

           

          "tfennelly" wrote:
          Hey Scott... as it turns out, Kevin would also like the static option, so we'll be adding this too. It will look something like the following...

          <http-gateway....>
           <asyncResponse status="202" payload="/async-responses/202.xml" />
          </http-gateway>


          This seem OK?

          So both options will be available... the more dynamic version we described above, as well as this static version.


          Sounds good. I think in some cases the dynamic version will be necessary, for example, when I want to provide a status link that's different for each request. The static version covers the simple case where a generic response is sufficient.

          Thanks,
          Scott


          • 77. Re: Http Gateway - requirements please...
            Tom Fennelly Master

            Actually... I implemented this slightly differently so as to allow setting of the contentType and characterEncoding (optional) when a payload is specified...

            <asyncResponse statusCode="202">
             <payload classpathResource="/readme.txt" contentType="text/plain" characterEncoding="UTF-8" />
            </asyncResponse>


            • 78. Re: Http Gateway - requirements please...
              Scott Dawson Apprentice

              Tom,
              Using your workspace/tfennelly/httpg2 code, I've got a small http-gateway prototype up and running. The initial GET comes in through the gateway and triggers another GET on an RSS feed via HttpRouter. The RSS is transformed into HTML using XsltAction, then returned to the client.

              It works great but there's one thing I had to write code for that I think may be configurable in jboss-esb.xml. The content-type HTTP header of the RSS feed is different from the content-type header that I need to send back to the client, so I wrote a few lines of code in a custom action to set the content-type header for the final response:

               HttpResponse responseInfo = new HttpResponse(200);
               responseInfo.setContentType("text/html");
               responseInfo.setResponse(message);
               return message;
              


              Is there a way to do that with configuration instead of code, i.e. a way to specify HTTP headers for the response?

              Thanks,
              Scott


              • 79. Re: Http Gateway - requirements please...
                Tom Fennelly Master

                Hi Scott.

                Right, this isn't possible at the moment, but I see no reason why we can't add support for it. Seems like something others will also run into. I created a JIRA: https://jira.jboss.org/jira/browse/JBESB-2832

                BTW... the new http-gateway is now available on trunk.

                1 2 3 4 5 6 Previous Next