4 Replies Latest reply on Jun 27, 2008 12:30 PM by kconner

    Problem in passing Object to WebService Consumer

    gopi12345

      Hi,

      I am trying to pass an serializable object to the WebService Consumer and the values set in this object is empty when it comes to WebService Consumer class.

      Here are the codes:

      public class SendEsbMessage
      {

      private void sendMessage(MyObject myObject) throws Exception
      {
      System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
      ServiceInvoker deliveryAdapter = new ServiceInvoker("QCareWebService","RequestReplyWebService");

      System.out.println("Object Value is: " + myObject.getxxx()); // I can print the value here.
      Message requestMessage = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
      requestMessage.getBody().add(myObject);
      replyMessage = deliveryAdapter.deliverSync(myObject, 20000);


      }

      ###############################################

      public class MyRequestAction extends AbstractActionLifecycle
      {

      ..................

      @SuppressWarnings("unchecked")
      public Message process(Message message) throws Exception {
      MyObject msgBody = (MyObject ) message.getBody().get();

      System.out.println("Object Value is: " + myObject.getxxx()); // I can print this value

      HashMap requestMap = new HashMap();

      requestMap.put("requestParameter", msgBody);
      message.getBody().add(requestMap);

      return message;
      }



      }
      ##############################################

      @WebService(name = "MyWebService", targetNamespace = "http://MyServer/MyWebService")

      public class MyObjectProcessorWS
      {
      @WebMethod
      public String processMyObject(@WebParam(name = "requestParameter") MyObject myObject)
      {
      // here the value of myObject is empty -- It is not null!!

      System.out.println("Object Value is: " + myObject.getxxx());


      return status;

      }
      }



      ##########################

      Can somebody help me ?

      Thanks in advance
      Gopi

        • 1. Re: Problem in passing Object to WebService Consumer
          jpechanec

          Hi,

          can you please post your jboss-esb.xml file?

          Thanks

          • 2. Re: Problem in passing Object to WebService Consumer
            gopi12345

            Here it is.....

            <?xml version = "1.0" encoding = "UTF-8"?>
            <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
            
             <providers>
             <jms-provider name="JBossMQ"
             connection-factory="ConnectionFactory"
             jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
             jndi-URL="localhost">
             <jms-bus busid="qcareGwChannel">
             <jms-message-filter
             dest-type="QUEUE"
             dest-name="queue/qcare_webservice_requestreply_gw"
             />
             </jms-bus>
            
             <jms-bus busid="qcareEsbChannel">
             <jms-message-filter dest-type="QUEUE"
             dest-name="queue/qcare_webservice_requestreply_esb" />
             </jms-bus>
            
             </jms-provider>
             </providers>
            
             <services>
             <service category="QCareWebService" name="RequestReplyWebService"
             description="QCare Request Reply Webservice">
             <listeners>
             <jms-listener name="JMS-ESBListener"
             busidref="qcareEsbChannel" maxThreads="1" />
             <jms-listener name="JMS-Gateway"
             busidref="qcareGwChannel"
             maxThreads="1"
             is-gateway="true"
             />
            
             </listeners>
             <actions mep="RequestResponse">
             <action name="request-mapper"
             class="com.wipro.qcare.esb.actions.QCareESBRequestAction">
             </action>
             <action name="soapui-client-action"
             class="org.jboss.soa.esb.actions.soap.SOAPClient">
             <property name="wsdl"
             value="http://127.0.0.1:8080/QCareV10/QCareWebService?wsdl" />
             <property name="responseAsOgnlMap" value="true" />
             <property name="SOAPAction" value="invokeQCareRequestReply"/>
             </action>
             <action name="response-mapper"
             class="com.wipro.qcare.esb.actions.QCareESBResponseAction">
             </action>
             <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
             </actions>
             </service>
             </services>
            
            </jbossesb>
            


            • 3. Re: Problem in passing Object to WebService Consumer
              gopi12345

              Can somebody answer to this please?

              • 4. Re: Problem in passing Object to WebService Consumer
                kconner

                Okay, so lets start with the obvious

                1. This is *not* a support channel, it is a forum where we provide help on a *best effort* basis. If you need proper support then I suggest you purchase a proper support contract.

                2. It is obvious that the jboss-esb.xml file you posted does *not* match the code you also posted, so which is it? What are we supposed to check against?

                3. If you want my guess, and it is only a guess mind you, the fault lies in QCareESBRequestAction (or whatever you really call it) and it is likely to be that you have not specified the correct key for your parameter.