0 Replies Latest reply on May 12, 2008 12:04 AM by rknaik

    Need Help in Exposing Web service method

    rknaik

      Hello,
      I have written a web service using jboss ws. I have exposed one of methods as follows:

      
      @WebMethod
       public String getDevDetails(@WebParam(name="dev") String devName)
       {
       String devDetails = null;
       try
       {
       if(null != devName)
       {
       devDetails = genericAccess.getDeviceDetails(devName);
       }
       }
       catch (DAOException e)
       {
       e.printStackTrace();
       }
       return devDetails ;
       }
      
      
      


      Now in the above method instead of returning a string object i want to return a user defined object of type DeviceDetails say devObj as follows.


      
      @WebMethod
       public DeviceDetails getDevDetails(@WebParam(name="dev") String devName)
      {
       DeviceDetails devObj = null;
       devObj = access.getDevDetails(devName);
      
       return devObj;
      }
      
      


      How do i achieve this ?

      And my client code makes use of jboss remoting apis to invoke the above method.

      
      InvokerLocator locator = new InvokerLocator(protocol + host_address + port);
       if(null == remotingClient)
       {
       remotingClient = new Client(locator);
       }
       remotingClient.connect();
      Object response = remotingClient.invoke(soapMessage);
      
      


      Here the response i get is SOAP response. But i am expecting an object of type DeviceDetails as a response.
      How do i achieve this ?

      Someone please help me .. :(

      Thanks
      R.Naik