1 2 Previous Next 23 Replies Latest reply on Feb 5, 2010 3:40 PM by anso2 Go to original post
      • 15. Re: Consistent handling of HTTP response header across HTTP
        dward

        $ svn commit
        Sending product/rosetta/src/org/jboss/soa/esb/actions/routing/http/HttpRouter.java
        Sending product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java
        Sending product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java
        Sending product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
        Sending product/rosetta/src/org/jboss/soa/esb/message/ResponseHeader.java
        Sending product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/AbstractWsdlContractPublisher.java
        Sending product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
        Sending product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
        Sending product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/SOAPClient_Response_UnitTest.java
        Transmitting file data .........
        Committed revision 27450.

        https://jira.jboss.org/jira/browse/JBESB-2511 is now resolved. Fix Version: 4.6.

        • 16. Re: Consistent handling of HTTP response header across HTTP
          rmolin

          Any idea when this will make it into the SOA platform ? - We have a corrective action that probably needs to be removed once this is in place.

          Rune

          • 17. Re: Consistent handling of HTTP response header across HTTP
            dward

            I'll let Kev answer that. ;)

            PS: I broke a unit test with the above changes. My bad. I've fixed it and am running a full integration test now. :(

            • 18. Re: Consistent handling of HTTP response header across HTTP
              dward

              Fixed:

              $ svn commit services/soap/src/test/java/org/jboss/soa/esb/actions/soap/SOAPClient_Response_UnitTest.java services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
              Sending services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
              Sending services/soap/src/test/java/org/jboss/soa/esb/actions/soap/SOAPClient_Response_UnitTest.java
              Transmitting file data ..
              Committed revision 27459.

              • 19. Re: Consistent handling of HTTP response header across HTTP
                kconner

                 

                "rmolin" wrote:
                Any idea when this will make it into the SOA platform ? - We have a corrective action that probably needs to be removed once this is in place.

                David's work is going into the project for the 4.6 release. The current plan is to make another project release, 4.7, towards the end of September and use that as the basis for the SOA 5 platform.

                Kev

                • 20. Re: Consistent handling of HTTP response header across HTTP
                  dward

                  ESB 4.6 has been released, containing the fixes. Please give it a shot. Comments/criticism welcome.

                  • 21. Re: Consistent handling of HTTP response header across HTTP comp
                    anso2

                    A note on the JBR Gateway.I ran into a problem where my Content-Type ResponseHeader, which I set in the message properties to "text/xml", was not reflected in the final HTTP response. I found that the problem is in the JBoss Remoting transport layer. The CoyoteInvoker overrides the content type in the versionedWrite method. This method is using WebUtil class that makes decision about content type based on type of the responseObject. If it is String it always returns "text/html" otherwise it uses "application/octet-stream".

                     

                    This is confusing because according to ESB spec you should be able to customize all the response headers in your action classes by setting ResponseHeader instances  in the message properties.

                     


                    • 22. Re: Consistent handling of HTTP response header across HTTP comp
                      tfennelly

                      Can you let us know what version of the ESB you are using, as well as the config and any other info please.  This sounds like something that should have been resolved in the HttpMarshaller and HttpUnmarshaller implementations that were added to the ESB.

                       

                      Also... if this is something new that you're working on... please take a look at the <http-gateway>.

                      • 23. Re: Consistent handling of HTTP response header across HTTP comp
                        anso2

                        I am using jboss-4.2.1.GA as my application server and jbossesb-4.6. for my ESB. This does not seem to be a configuration specific issue. I believe that the issue is in the jboss-remoting.jar that comes with the application server. This is where the override content type happens. I also checked newer versions of remoting and it looks like this is still handled in the same way.

                         

                        Take a look at org.jboss.remoting.transport.coyote.CoyoteInvoker (line 423 and 424)

                        String responseContentType = responseObject == null ? req.getContentType() : WebUtil.getContentType(responseObject);

                        res.setContentType(responseContentType);

                         

                        and the WebUtil looks like this:

                         

                           public static String getContentType(Object param)
                           {
                              if(param instanceof String)
                              {
                                 return HTML;
                              }
                              else
                              {
                                 return BINARY;
                              }
                           }

                         

                        So if your payload is String, it will always be text/html. This is causing issues when you use JBR Gateway with web services where text/xml is expected.

                        1 2 Previous Next