6 Replies Latest reply on Mar 6, 2009 11:25 AM by Kevin Conner

    ESB webservice call problem

    Alex Dorandish Newbie

      Hi,

      I deployed a webservice with the following code to jboss:

      /*
       * To change this template, choose Tools | Templates
       * and open the template in the editor.
       */
      
      package com.cayenta.webservices;
      
      import javax.jws.WebMethod;
      import javax.jws.WebParam;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      
      /**
       *
       * @author dorand
       */
      @WebService(name="ExternalEmployee")
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      public class ExternalEmployee {
      
       /**
       * Web service operation
       */
       @WebMethod(operationName = "getEmployeeName")
       public String getEmployeeName(@WebParam(name = "message")
       String message) {
       //TODO write your implementation code here:
       return "Alex ("+message+")";
       }
      
      }
      


      then I consumed it with ESB like:

      <?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.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
       <providers>
       <jms-provider connection-factory="ConnectionFactory" name="JBossMQ">
       <jms-bus busid="cayentaEmployeeEsbChannel">
       <jms-message-filter dest-name="queue/CayentaEmployeeEsbChannel" dest-type="QUEUE"/>
       </jms-bus>
       </jms-provider>
       <jbr-provider name="CayentaEsbHttpProvider" protocol="http">
       <jbr-bus busid="CayentaEsbChannel" port="8765"/>
       </jbr-provider>
       </providers>
       <services>
       <service category="Cayenta" description="Cayensta ESB" name="CayentaEmployee">
       <listeners>
       <jms-listener busidref="cayentaEmployeeEsbChannel" name="JMS-ESBListener"/>
       <jbr-listener busidref="CayentaEsbChannel" is-gateway="true" name="CayentaEsbHttpListener"/>
       </listeners>
       <actions mep="OneWay">
       <action class="org.jboss.soa.esb.actions.SystemPrintln" name="print-before">
       <property name="message" value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint"/>
       </action>
       <action class="org.jboss.soa.esb.actions.soap.SOAPClient" name="ExternalWsInESB">
       <property name="wsdl" value="http://localhost:8080/ExternalWS/ExternalEmployee?wsdl"/>
       <property name="operation" value="getEmployeeName"/>
       <property name="SOAPAction" value="getEmployeeName"/>
       </action>
       <action class="org.jboss.soa.esb.actions.SystemPrintln" name="print-after">
       <property name="message" value="[Quickstart_webservice_producer] AFTER invoking jbossws endpoint"/>
       </action>
       <action class="org.jboss.soa.esb.actions.TestMessageStore" name="testStore"/>
       </actions>
       </service>
       </services>
      </jbossesb>
      


      then I looked at the contract page and I see:

       Cayenta:CayentaEmployee Cayensta ESB
      HTTP
      
       * Endpoint: http://dorands-macbook-pro.local:8765
       * Contract: http://localhost:8080/contract/contract.jsp?serviceCat=Cayenta&serviceName=CayentaEmployee&protocol=http
      
      JMS
      
       * Endpoint: jms://localhost:1099/queue/CayentaEmployeeEsbChannel
       * Contract: http://localhost:8080/contract/contract.jsp?serviceCat=Cayenta&serviceName=CayentaEmployee&protocol=jms
      


      then I used the following to generate client web service:

      http://localhost:8080/contract/contract.jsp?serviceCat=Cayenta&serviceName=CayentaEmployee&protocol=http


      When I call the web service I see:

      18:06:06,819 INFO [STDOUT] [Quickstart_webservice_producer] BEFORE invoking jbossws endpoint:
      18:06:06,821 INFO [STDOUT] [<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
       <S:Body>
       <ns2:getEmployeeName xmlns:ns2="http://webservices.cayenta.com/">
       <message/>
       </ns2:getEmployeeName>
       </S:Body>
      </S:Envelope>
      ].
      18:06:06,823 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://localhost:1099/queue/CayentaEmployeeEsbChannel/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] ReplyTo: JMSEpr [ PortReference < <wsa:Address jms://localhost:1099/queue/CayentaEmployeeEsbChannel_reply/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:message-selector : jbossESBresponseUUID='3d48d400-6a6f-49aa-a706-23a843ae85f7'/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: ba5bfa40-9dd9-4c50-98d7-f6b3faf32009 RelatesTo: jms:correlationID#ba5bfa40-9dd9-4c50-98d7-f6b3faf32009
      18:06:26,820 INFO [ServiceInvoker] Unresponsive EPR: JMSEpr [ PortReference < <wsa:Address jms://localhost:1099/queue/CayentaEmployeeEsbChannel/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : localhost:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] for message: header: [ ]
      18:06:26,820 INFO [ServiceInvoker] Badly formed EPR [EPR: PortReference < <wsa:Address http://dorands-macbook-pro.local:8765/> >] for Service [Cayenta:CayentaEmployee] and Message [header: [ ]].Courier for EPR not supported: ESB-unaware EPR used!
      18:06:26,821 INFO [ServiceInvoker] Delivering message [header: [ ]] to DLQ.
      18:06:26,843 ERROR [JBossRemotingGatewayListener] JBoss Remoting Gateway failed to synchronously deliver message to target service [Cayenta:CayentaEmployee].
      org.jboss.soa.esb.listeners.message.MessageDeliverException: Failed to deliver message [header: [ ]] to Service [Cayenta:CayentaEmployee]. Check for errors.
       at org.jboss.soa.esb.client.ServiceInvoker.post(ServiceInvoker.java:414)
       at org.jboss.soa.esb.client.ServiceInvoker.deliverSync(ServiceInvoker.java:213)
       at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSyncWithoutDecomposing(UncomposedMessageDeliveryAdapter.java:107)
       at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSync(UncomposedMessageDeliveryAdapter.java:86)
       at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.invoke(JBossRemotingGatewayListener.java:352)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:809)
       at org.jboss.remoting.transport.coyote.CoyoteInvoker.service(CoyoteInvoker.java:310)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:613)
      


        • 1. Re: ESB webservice call problem
          Scott Dawson Apprentice

          Change the mep on the actions element to "RequestResponse" instead of "OneWay".
          The JBossRemotingGatewayListener is waiting for a response to come back and throwing an exception when it doesn't get one.

          • 2. Re: ESB webservice call problem
            Alex Dorandish Newbie

            Thanks Scott. I am getting this error message now:

            19:45:39,534 ERROR [JBossRemotingGatewayListener] JBoss Remoting Gateway failed to synchronously deliver message to target service [Cayenta:CayentaEmployee].
            org.jboss.soa.esb.couriers.FaultMessageException: org.jboss.soa.esb.actions.ActionProcessingException: Invalid payload type in message body location 'org.jboss.soa.esb.message.defaultEntry'. Expected 'java.util.Map', was 'java.lang.String'.
             at org.jboss.soa.esb.listeners.message.errors.Factory.createExceptionFromFault(Factory.java:50)
             at org.jboss.internal.soa.esb.couriers.helpers.JmsComposer.compose(JmsComposer.java:82)
             at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:401)
             at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:228)
             at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:204)
             at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.attemptDelivery(ServiceInvoker.java:625)
             at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.access$200(ServiceInvoker.java:523)
             at org.jboss.soa.esb.client.ServiceInvoker.post(ServiceInvoker.java:355)
             at org.jboss.soa.esb.client.ServiceInvoker.deliverSync(ServiceInvoker.java:213)
             at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSyncWithoutDecomposing(UncomposedMessageDeliveryAdapter.java:107)
             at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSync(UncomposedMessageDeliveryAdapter.java:86)
             at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.invoke(JBossRemotingGatewayListener.java:352)
             at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:809)
             at org.jboss.remoting.transport.coyote.CoyoteInvoker.service(CoyoteInvoker.java:310)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
             at java.lang.Thread.run(Thread.java:613)
            Caused by: org.jboss.soa.esb.actions.ActionProcessingException: Invalid payload type in message body location 'org.jboss.soa.esb.message.defaultEntry'. Expected 'java.util.Map', was 'java.lang.String'.
             at org.jboss.soa.esb.actions.soap.SOAPClient.process(SOAPClient.java:401)
             at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:633)
             at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:585)
             at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:419)
             at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:548)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
             ... 1 more
            19:45:39,535 ERROR [CoyoteInvoker] Error processing request
            java.io.NotSerializableException: org.jboss.internal.soa.esb.message.format.xml.MessageImpl
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
             at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
             at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObjectVersion1_2(JavaSerializationManager.java:107)
             at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:91)
             at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:120)
             at org.jboss.remoting.marshal.http.HTTPMarshaller.write(HTTPMarshaller.java:73)
             at org.jboss.internal.soa.esb.remoting.HttpMarshaller.write(HttpMarshaller.java:51)
             at org.jboss.remoting.transport.coyote.CoyoteInvoker.versionedWrite(CoyoteInvoker.java:434)
             at org.jboss.remoting.transport.coyote.CoyoteInvoker.service(CoyoteInvoker.java:377)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
             at java.lang.Thread.run(Thread.java:613)
            


            • 3. Re: ESB webservice call problem
              Scott Dawson Apprentice

              SOAPClient expects the operation parameter(s) in a map, as described here:
              http://www.jboss.org/community/docs/DOC-11949
              but you are sending in a SOAP envelope.
              If you want to send in the SOAP envelope and just have it routed on through to the web service, then you might want to try the HTTPRouter instead of SOAPClient.
              HTTPRouter is described here:
              http://www.jboss.org/community/docs/DOC-9973

              • 4. Re: ESB webservice call problem
                Alex Dorandish Newbie

                I add the params now it passes the parameters and calls the service properly. But the message coming back is a map as well.

                But I want to receive a Soapenv as stream.

                Here is the scenario:
                You are requesting an object from a webservie like and employee. The date of birth for this employee is needed to be changed and then the result to be sent to my WS client in a SOAPENV

                I created two mapper, response and request.

                How do I turn the response to a soap env?

                • 5. Re: ESB webservice call problem
                  Alex Dorandish Newbie

                  when I do proxy, I cannot expose the wsdl anymore. or can I?

                  • 6. Re: ESB webservice call problem
                    Kevin Conner Master

                     

                    "adorandish" wrote:
                    I add the params now it passes the parameters and calls the service properly. But the message coming back is a map as well.

                    But I want to receive a Soapenv as stream.


                    You could use JBR/HttpRouter or JBR/SOAPProcessor if co-located. The webservice_mtom shows an example of the latter.

                    Kev