1 Reply Latest reply on Jun 24, 2008 10:21 AM by Jiri Pechanec

    Trying again: How to access a webservice provided by JBR?

    Luiz Antonio Falaguasta Barbosa Novice

      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:

      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

      Observation: Please, think about some lines above like tags.

      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.

      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.

      Stefan Lecho said that the following post is related: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158192#4158192

      T. Fennelly said:
      "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 :-)"

      So, I said:
      "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?"

      To point to an endpoint provided by JBoss ESB for a webservice client access it should be something basic, right?

      Please, I just need to know where can I find the complete endpoint offered by JBoss ESB and how can I use is-gateway=true in a way that it runs.

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

      Thanks in advance!

      Luiz

        • 1. Re: Trying again: How to access a webservice provided by JBR
          Jiri Pechanec Apprentice

          Hi Luiz,

          you must still have in mind that each service MUST have at least one listener that processes ESB aware messages (marked with is-gateway="false"). In this case it will use JMS or file provider.

          And you CAN have one or more gateways for each service that processes messagees in external format (non-aware). In this case it will use jbr-provider.

          So in your case you MUST have two providers
          1) jbr-listner which will serve as gateway (is-gateway="true")
          2) jms- or fs- listener that will server as listener (is-gateway="false")

          The gateway will take the message from external system (i.e. SOAP over HTTP here), translates it into ESB message (puts it into special Java data structures) and sends it into service listener (JMS queue). Service lisner will read the message (from queue) and start the action processing.

          Moreover you probaly want to use SOAPprocessor action for this scenario - look at webservice_producer quickstart