4 Replies Latest reply on Jul 27, 2010 1:05 PM by kimba74

    SOAPProcessor problems with HTTP-Gateway?

    kimba74

      Hi everyone,

       

      I know it is a very common question discussed in this forum and others but I haven't found a solution to it yet. Here is the problem I'm facing and my approach of how I tried to solve it:

       

      Problem:

      I want to expose my ESB Service via Web Service so that other applications can consume it directly by making a WS call. When starting with this I was hoping I could just expose a WSDL through my listeners but aparently JBoss doesn't have any means of exposing a pre-existing WSDL as contract. So here is what I did.

       

      Approach:

      I created a JSR-181 Web Service as a shell to be the handler for the incoming SOAP request. Then I configured my action-pipeline to have a SOAPProcessor using this previously created Web Service and expose it's WSDL as contract. Next I configured a http-gateway as listener so my Web Service is listening on the default HTTP port(s) exposed by the Web Server. Everything compiled, built and deployed well but when I looked into the Contracts application the http-gateway doesn't seem to be recognized as an endpoint of my service and therefore also no contract gets published. The endpoint (under: http://<host>[:<port>]/<.esb>/http/<servercat>/<servername> seems to handle my SOAP requests correctly but the WSDL could not be found. If I try using the same URL with '?wsdl' at the end I only get a response that says <definitions/>.

       

      However when I use the JBR listener with the HTTP protocol instead of the HTTP-Gateway it seems to be working fine. The only problem why I can't use JBR is because I need to run my as Web Service exposed ESB Services through the HTTP(S) ports used by the server.

       

      What am I missing or doing wrong??

       

      Source (jboss-esb.xml):

       

      ...
      <service category="MyCat" name="MyWSEP" description="" invmScope="GLOBAL">
         <listeners>
            <http-gateway name="HTTPConsumer"/>
         </listeners>
         <actions>
            <action name="print_message_1" class="mystuff.PrintMessageAction"/>
            <action name="process_ws_call" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
               <property name="jbossws-endpoint" value="jumconsumer"/>
            </action>
            <action name="print_message_2" class="mystuff.PrintMessageAction"/>
         </actions>
      </service>
      ...
      

       

      My Environment:

      • JBossAS 4.2.3
      • JBossESB 4.8
      • Ubuntu 10.4
      • JDK 1.6.0_20

       

       

      Can anybody help me??

       

      --Kimba

        • 1. Re: SOAPProcessor problems with HTTP-Gateway?
          kimba74

          Ok, I have been fiddling around with this all weekend and for some reason the http-gateway doesn't seem to show op in the contract application at all. Am I missing something (or doing something wrong)?

           

          I've tried the following combinations:

          • AS 4.2.3 + ESB 4.7
          • AS 4.2.3 + ESB 4.8
          • AS 5.1.0 + ESB 4.7
          • AS 5.1.0 + ESB 4.8

           

          All without any success, which leads me to the assumption that I'm doing something wrong or missed something. Any ideas?

           

          Thanks,

           

          Kimba

          • 2. Re: SOAPProcessor problems with HTTP-Gateway?
            kconner

            The console relies on the registry, which is a bug, rather than using the known contract publishers.  Try adding a non-invm listener to the service definition, this will have the side-effect of exposing it.

             

            Kev

            • 3. Re: SOAPProcessor problems with HTTP-Gateway?
              kimba74

              Thanks Kevin for the suggestion. I tried adding a JMS listener to it which shows up fine in the contract application. However, using ESB 4.8 the contract posted for the JMS endpoint shows up as "Unavailable". Same deployable on ESB 4.7 shows up with a contract URL for the JMS endpoint. But I still don't see the http-gateway being even listed as an endpoint in the contract application. Is this the bug you refer to? I can live with the fact that the http-gateway is not being listed as an endpoint in the contract application but I don't seem to be able to retrieve its WSDL either which makes developing a client for it some sort of guess-work if you are not the developer of the ESB Service.

               

              Any suggestions?

               

              Thanks,

               

              Kimba

              • 4. Re: SOAPProcessor problems with HTTP-Gateway?
                kimba74

                OK, I did some more research and after quite some reading and (for verification purposes) looking through the ESB 4.8 code I found the issue. David Ward actually pointed it out in one of his posts (http://community.jboss.org/thread/148527):

                 

                David Ward wrote:

                ...
                Right now, the SOAPProxyWsdlContractPublisher is the only Publisher that  implements ContractProvider.  When there is a Service whose action  pipeline contains an action that is annotated with @Publish, and the  associated Publisher implements ContractProvider, then the  HttpGatewayServlet knows to ask it to provide the ContractInfo so it can  respond to the WSDL request appropriately.  However, if a ?wsdl request  is made to the servlet and there is no ContractProvider, it simply  spits out an empty <definitions/> WSDL contract.  This is expected  behavior.
                ...

                 

                After reading this I looked into the ESB 4.8 code and sure enough, SOAPProcessor uses the class JBossWSWebserviceContractPublisher as contract publisher which does not implement the ContractProvider interface (yet!?).

                 

                Having that said, right now it seems like the only way of exposing your ESB Service as Web Service through HTTP with the correct WSDL published is by using EBWS. The JBR is not really an option since one would have to configure one port per service and nobody wants to poke that many holes into their firewall. And also the SOAPProxy seems to fall out of the picture since (as I understand it) it only proxies another Web Service rather than processes the SOAP message as SOAPProcessor does. Or could I use the SOAPProxy in a similar way like the SOAPProcessor?

                 

                Now my (new) question(s): What is the ETA on having the other contract publisher classes upgraded to support the WSDL publishing through http-gateway? And is there a viable work-around for this until this issue has been resolved?

                 

                Any suggestions?

                 

                Thanks,

                 

                Kimba