3 Replies Latest reply on Mar 18, 2010 4:25 AM by h.wolffenbuttel

    HTTP Router Contract

      I've had trouble with the SOAPProxy class and attempting a solution instead with HTTPRouter.  The HTTP Endpoint is being created correctly but no wsdl, the contract is unavailable.  I've attached my jboss-esb.xml.  Any ideas why contract is unavailable?

       

      <?xml version="1.0"?>
      <jbossesb parameterReloadSecs="5"
       xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
       <providers>
        <jbr-provider name="StockHttpGateway" protocol="http" host="192.168.119.50">
         <jbr-bus busid="StockHttpGateway" port="8567"/>
        </jbr-provider>
       </providers>
       <services>
        <service category="Stock_Quote" description="Stock Quote Service" invmScope="GLOBAL" name="Stock_Quote">
         <listeners>
          <jbr-listener busidref="StockHttpGateway" is-gateway="true" name="StockHttpGateway"/>
         </listeners>
         <actions mep="RequestResponse">
          <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter" name="HttpRouter">
           <property name="endpointUrl" value="http://209.162.186.60/stockquote.asmx?wsdl"/>
           <property name="method" value="POST"/>
           <property name="responseType" value="STRING"/>
          </action>
          <action class="org.jboss.soa.esb.actions.SystemPrintln" name="message">
           <property name="message" value="In the ESB"/>
          </action>
         </actions>
        </service>
       </services>
      </jbossesb>
      

       

      Thanks,
      jhenry

        • 1. Re: HTTP Router Contract
          h.wolffenbuttel

          Hi Jonathan,

           

          The HTTPRouter does not register a contract, it is just there to connect to another HTTP-endpoint or a Webservice. The way to get a contract is to make your service into a webservice with inxsd and outxsd defined and webservice="true" in your actions declaration. Take notice of the fact that you need both (inxsd and outxsd) for RequestResponse.

           

          Regards,

           

          Hans

          1 of 1 people found this helpful
          • 2. Re: HTTP Router Contract

            Thank you for the response.  I'm having trouble finding an example that references a webservice.  Do you know of a good example I could use for reference?

             

            Thanks,

            jhenry

            • 3. Re: HTTP Router Contract
              h.wolffenbuttel

              Hi,

               

              The quickstart publish as a webservice does just that: http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice

               

              The in and outxsd are ment for validating the messages but that can be overidden by setting validate="false" in the actions configuration.

               

              here an example:

               

              {code:xml}

              <services>
                <service category="httpgateway" description="Send messages" invmScope="NONE" name="MessageSender">

                 <listeners>

                  <jms-listener busidref="listenerBus" is-gateway="false"

                   maxThreads="50" name="BusListener"/>

                 </listeners>

                 <actions faultXsd="/somewheredef.xsd" inXsd="/somewheredef.xsd"

                  mep="RequestResponse" outXsd="/somewheredef.xsd" validate="false" webservice="true">

                  <action class="nl.gouwit.esb.actions.HttpDynamicRouter" name="SendAction">

                   <property name="endpointUrl" value="http://127.0.0.1:2255/SomeWhereListener?WSDL"/>

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

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

                   <property name="debug" value="false"/>

                   <property name="headers">

                    <header name="SOAPAction" value="http://www.somewhere.com/"/>

                    <header name="operation" value="anOperationname"/>

                   </property>

                  </action>

                 </actions>

                </service>

              {code}

               

              Regards,

               

              Hans