14 Replies Latest reply on Jun 16, 2008 7:49 AM by lafbarbosa

    How to access a webservice provided by JBR?

    lafbarbosa

      Hi people,

      I created a .esb package to provide a webservice through JBoss ESB.

      This webservice has already been provided directly in a client-server fashion. But now, I want to offer this webservice with the JBoss ESB in the middle.

      In other words, I want that the original client can request the service in the same way it was been doing before, pointing to a WSDL.

      So, what I did it was to write the following jboss-esb.xml descriptor:

      <?xml version = "1.0" encoding = "UTF-8"?>


      <jbr-provider name="8ball-provider" protocol="http" host="localhost">
      <jbr-bus busid="8ball-bus" port="8089" />
      </jbr-provider>




      <jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"/>




      <!--property name="responseAsOgnlMap" value="true" /-->







      So, I wait that the client could call the webservice, but now, for the JBoss ESB. But, I don't know how. Because, I didn't find any information about the WSDL generated by the JBoss ESB to publish the .esb package that represents the real endpoint. Should it be http://localhost:8089/8ballServiceCategory/8ballService?wsdl ?

      I took a look at the /contract of my JBoss ESB, but it only shows .esb packages published through JMS providers. And, when I deployed my 8ball.esb package it worked (when I was trying to deploy it with the value true to the attribute is-gateway into the descriptor, the package couldn't be deployed).

      More information:

      The webservice is running at http://192.168.5.78:8080/Treina/services/BolaOito?wsdl (as you can see into the XML descriptor) and the method that if provides is getResposta (is it right to put this as value of value attribute of tag property into tag action of the XML descriptor? And what about the commented tag above, should I uncomment it?), which receives String and returns String.

      Please, if somebody could help me, I will really appreciate it.

      Thanks in advance!

      Luiz

        • 1. Re: How to access a webservice provided by JBR?
          lafbarbosa

          Sorry people, but the forum system truncated the XML descriptor.

          This is the entire descriptor:

          <?xml version = "1.0" encoding = "UTF-8"?>



          <jbr-provider name="8ball-provider" protocol="http" host="localhost">
          <jbr-bus busid="8ball-bus" port="8089" />
          </jbr-provider>





          <jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"/>




          <!--property name="responseAsOgnlMap" value="true" /-->






          • 2. Re: How to access a webservice provided by JBR?
            lafbarbosa

            Yeah, it cut again. Let's see now:

            <?xml version = "1.0" encoding = "UTF-8"?>



            <jbr-provider name="8ball-provider" protocol="http" host="localhost">
            <jbr-bus busid="8ball-bus" port="8089" />
            </jbr-provider>





            <jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"/>




            <!--property name="responseAsOgnlMap" value="true" /-->






            • 3. Re: How to access a webservice provided by JBR?
              lafbarbosa

              Ok. Now in pieces:


              <jbr-provider name="8ball-provider" protocol="http" host="localhost">
              <jbr-bus busid="8ball-bus" port="8089" />
              </jbr-provider>

              • 4. Re: How to access a webservice provided by JBR?
                lafbarbosa




                <jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"/>

                • 5. Re: How to access a webservice provided by JBR?
                  lafbarbosa




                  <jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"/>

                  • 6. Re: How to access a webservice provided by JBR?
                    lafbarbosa




                    <jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"/>

                    • 7. Re: How to access a webservice provided by JBR?
                      lafbarbosa

                      Ok. It doesn't matter. Let's continue.



                      <!--property name="responseAsOgnlMap" value="true" /-->

                      • 8. Re: How to access a webservice provided by JBR?
                        lafbarbosa




                        <jbr-provider name="8ball-provider" protocol="http" host="localhost">
                        <jbr-bus busid="8ball-bus" port="8089" />
                        </jbr-provider>





                        <jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"/>




                        <!--property name="responseAsOgnlMap" value="true" /-->





                        • 9. Re: How to access a webservice provided by JBR?
                          lafbarbosa

                          Now, without the tag symbols.

                          jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5"

                          providers
                          jbr-provider name="8ball-provider" protocol="http" host="localhost"
                          jbr-bus busid="8ball-bus" port="8089"
                          /jbr-provider
                          /providers
                          services
                          service category="8ballServiceCategory" name="8ballService" description="Exemplo do webservice 8-ball acessado via ESB"
                          listeners
                          jbr-listener name="Http-Gateway" busidref="8ball-bus" is-gateway="false" maxThreads="1"
                          /listeners
                          actions mep="RequestResponse"
                          action name="soapui-client-action" class="org.jboss.soa.esb.actions.soap.SOAPClient"
                          property name="wsdl" value="http://192.168.5.78:8080/Treina/services/BolaOito?wsdl"
                          !--property name="responseAsOgnlMap" value="true" --/
                          property name="SOAPAction" value="getResposta"
                          /action
                          /actions
                          /service
                          /services
                          /jbossesb

                          • 10. Re: How to access a webservice provided by JBR?
                            lafbarbosa

                            Thanks forum system for don't truncate now! =)

                            • 11. Re: How to access a webservice provided by JBR?
                              lafbarbosa

                              I took a look at the http://<jboss esb host>:8080/contract and I could see this in the end:

                              8ballServiceCategory:8ballService
                              Exemplo do webservice 8-ball acessado via ESB

                              But it don't give me any information about a way to access the package which forwards requests to my webservice from my original client in a WSDL fashion.

                              • 12. Re: How to access a webservice provided by JBR?
                                stlecho
                                • 13. Re: How to access a webservice provided by JBR?
                                  tfennelly

                                  A bit lost in this post. Anyway... take a look at the webservice_producer quickstart.

                                  Also... you have is-gateway="false" on the jbr-listener config. Should be is-gateway="true". Not sure if this is your issue though, since I've no idea what you're actual issue is from this post :-)

                                  • 14. Re: How to access a webservice provided by JBR?
                                    lafbarbosa

                                    Thanks stlecho. I'll see the related post.

                                    tfennelly, about is-gateway =true, please, take a look what happens when I use it:

                                    08:34:53,308 INFO [JBoss4ESBDeployer] create esb service, 8ball.esb
                                    08:34:53,417 WARN [ServiceController] Problem starting service jboss.esb:deployment=8ball.esb
                                    java.lang.RuntimeException: org.jboss.soa.esb.ConfigurationException: Service configuration for Service '8ballServiceCategory:8ballService' doesn't define a Message-Aware Listener (i.e. is-gateway='false').
                                    at org.jboss.soa.esb.listeners.config.Configuration.create(Configuration.java:132)
                                    at org.jboss.soa.esb.listeners.config.JBoss4ESBDeployment.startService(JBoss4ESBDeployment.java:82)
                                    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                                    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                                    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:585)
                                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                                    at $Proxy0.start(Unknown Source)
                                    at org.jboss.system.ServiceController.start(ServiceController.java:417)
                                    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:585)
                                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                    at $Proxy56.start(Unknown Source)
                                    at org.jboss.soa.esb.listeners.config.JBoss4ESBDeployer.start(JBoss4ESBDeployer.java:375)
                                    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                                    at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:585)
                                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                    at $Proxy9.deploy(Unknown Source)
                                    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                                    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
                                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                                    Caused by: org.jboss.soa.esb.ConfigurationException: Service configuration for Service '8ballServiceCategory:8ballService' doesn't define a Message-Aware Listener (i.e. is-gateway='false').
                                    at org.jboss.soa.esb.listeners.config.Generator$XMLBeansModel.getListeners(Generator.java:377)
                                    at org.jboss.soa.esb.listeners.config.Generator$XMLBeansModel.getESBAwareListeners(Generator.java:250)
                                    at org.jboss.soa.esb.listeners.config.ESBAwareGenerator.generate(ESBAwareGenerator.java:83)
                                    at org.jboss.soa.esb.listeners.config.Generator.generate(Generator.java:147)
                                    at org.jboss.soa.esb.listeners.config.Configuration.create(Configuration.java:98)
                                    ... 46 more
                                    08:34:53,448 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

                                    --- MBeans waiting for other MBeans ---
                                    ObjectName: jboss.esb:deployment=8ball.esb
                                    State: FAILED
                                    Reason: java.lang.RuntimeException: org.jboss.soa.esb.ConfigurationException: Service configuration for Service '8ballServiceCategory:8ballService' doesn't define a Message-Aware Listener (i.e. is-gateway='false').
                                    I Depend On:
                                    jboss.esb:service=SoapUIClientService
                                    jboss.esb:deployment=jbossesb.esb
                                    jboss.esb:deployment=soap.esb

                                    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                                    ObjectName: jboss.esb:deployment=8ball.esb
                                    State: FAILED
                                    Reason: java.lang.RuntimeException: org.jboss.soa.esb.ConfigurationException: Service configuration for Service '8ballServiceCategory:8ballService' doesn't define a Message-Aware Listener (i.e. is-gateway='false').
                                    I Depend On:
                                    jboss.esb:service=SoapUIClientService
                                    jboss.esb:deployment=jbossesb.esb
                                    jboss.esb:deployment=soap.esb

                                    What I really would like to do is to continue to use my original webservice client, calling a WSDL, now represented by the .esb package into JBoss ESB, and this .esb package forwards the client request to the original endpoint (the original webservice server).

                                    In this way, please, what should I do to correct this problem with is-gateway=true?
                                    And how could I call the .esb package, from webservice client, in a WSDL fashion? Is it possible?

                                    Thanks in advance!

                                    Luiz