3 Replies Latest reply on Jan 28, 2011 5:25 AM by Tom Fennelly

    Need help with http-gateway on jboss esb

    nnpaul Newbie



      I try to do simple test for send POST request from GWT using RequestBuilder


              RequestBuilder rb=new RequestBuilder(RequestBuilder.POST, "http://localhost:8080/Test-Services/http/test/check");

              String xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n" +

                      "<request>\n" +

                      "<test>test</test>\n" +



              rb.setHeader("Content-type", "text/xml");

              try {


                  rb.sendRequest(xml,new RequestCallback(){


                      public void onResponseReceived(Request request, Response response) {



                      public void onError(Request request, Throwable throwable) {




              } catch (RequestException e) {





      And jboss-esb.xml is:



              <service category="Test" name="Service" description="" invmScope="GLOBAL">


                      <http-gateway name="test" busidref="testBus" urlPattern="test/*" payloadAs="STRING" />


                  <actions mep="RequestResponse">

                      <action name="dispatchAction" class="com.simpletest.esb.TestActions" process="dispatchAction"/>




      Request reach service, but when I print request info :


      20:17:10,370 INFO  [STDOUT] <org.jboss.soa.esb.http.HttpRequest>



















      I see that method is OPTIONS and Content-type is absent and I don't receive any XML data inside message body.


      May be someone faced with this or similar problem? What I am doing wrong?


      Thanks in advance.

        • 1. Re: Need help with http-gateway on jboss esb
          Scott Dawson Apprentice

          Can you try a simple (no GWT) test with an HTML form in a browser to verify that the ESB side is working? Something like:

          <form method="post" action="http://localhost:8080/Test-Services/http/test/check">

            <input type="text" name="a" value="99" />

            <input type="submit"/>



          On the GWT side, a quick Google search shows that there may be some problems with RequestBuilder when the URL uses "localhost". Try using the machine name in the URL when creating the RequestBuilder object.




          • 2. Need help with http-gateway on jboss esb
            nnpaul Newbie

            Yes, this test works fine without GWT .


            Using of the machine name or just didn't help.


            I've made some more test with RequestBuilder and found that only GET and HEAD method service receives fine, others POST,PUT and DELETE always as OPTIONS.


            Also I see the difference in headers only at this part:




            I don't see that block for GET and HEAD requests.


            I've made simple java servlet, and everything worked fine for POST and GET.


            I think the problem is on GWT side, becase  when I've made request from java using URLConnection, then I see normal request headers. I will try to ask on GWT forum regarding this problem.


            Regards, Paul.


            • 3. Need help with http-gateway on jboss esb
              Tom Fennelly Master

              You could put a sniffer in the middle and see the HTTP trafic going from your GWT app to the gateway... see the headers being passed in etc.