4 Replies Latest reply on May 10, 2011 9:42 AM by tcunning

    HttpRouter passing queryString

    madhucm

      Hi,

      I wrote up a sample ESB project which will  routs to http://in.search.yahoo.com/search.

       

      below is the config

       

      <service category="proxy" description="testProxy" invmScope="GLOBAL" name="testProxy">

         <listeners>

          <http-gateway name="testProxxyhttp">    

          </http-gateway>

         </listeners>

         <actions mep="RequestResponse">

          <action class="org.jboss.soa.esb.actions.SystemPrintln" name="dsfds">

           <property name="message" value="sdfsdf"/>

          </action>

          <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter" name="httpR">

           <property name="responseType" value="STRING"/>

           <property name="method" value="GET"/>

           <property name="endpointUrl" value="http://in.search.yahoo.com/search"/>

       

          </action>

         </actions>

        </service>

       

      In the web-browser if i type http://localhost:9000/ESBProxyServices/http/proxy/testProxy this will fetch me yahoo search page.

      But if i type same above url with query string http://localhost:9000/ESBProxyServices/http/proxy/testProxy?p=java it never shows

      search results.

       

      My doubt is how can i pass query string in httpRouter? so that i can see the search results.

       

       

      Thanks,

      Madhu CM

        • 1. HttpRouter passing queryString
          tcunning

          I don't think the HttpRouter is designed to handle something other than a static URL.     It would be quite easy to extend it and create a MadhuQueryStringHttpRouter action which appends the querystring from the message (logged from httpGateway) and attaches it to the endpointUrl in the config object.

          • 2. HttpRouter passing queryString
            madhucm

            Yep that is the only option i left.

            Thanks tom.

            • 3. HttpRouter passing queryString
              madhucm

              Is there any alternative way for passing queryString rather than creating custom java code ?

              I didnt find any documentation on this part :-(

               

              Thanks

              Madhu CM

              • 4. HttpRouter passing queryString
                tcunning

                Madhu CM wrote:

                 

                Is there any alternative way for passing queryString rather than creating custom java code ?

                I didnt find any documentation on this part :-(

                 

                Thanks

                Madhu CM

                 

                No.      You're going to have to extend HttpRouter.       The good news is that what you have to do is really trivial.