Results 1 to 2 of 2
  1. #1
    dream_ is offline Member
    Join Date
    Apr 2009
    Posts
    1
    Rep Power
    0

    Default Consuming web service with return custom object

    Hi to all.
    I'm writing a method java around with i'll write a web service (with jdeveloper).
    I want my method has this signature:

    public Employee method1 (String str1)
    {

    }

    where Employee is a private custom class I define in the same java source of method1 (I'm writing a java class with a method and than with jdeveloper automatically I'll wrap this class in a web service).
    Question is: how can consumer of my web service use returned object (of custom class Employee) if he does not know this custom class?
    Class Employee is private in java source...

    when he calls web service i think he'll have similar as follows:

    Employee em= webServ.method1("test");

    but he does not know Employee class. How could he use retuned object of web service?
    Thanks

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    Your Employee class should either extend a known class, or implement a known interface (preferred).

    It is possible to use reflection in cases like this, but it's sloppy as hell and will break the second someone changes anything.

Similar Threads

  1. Return an object to use in another method
    By TidusSolan in forum New To Java
    Replies: 3
    Last Post: 03-19-2009, 09:00 PM
  2. Replies: 1
    Last Post: 03-04-2009, 07:14 PM
  3. Consuming a Web Service using Java
    By gopikrishnatb in forum Web Frameworks
    Replies: 2
    Last Post: 03-02-2009, 10:59 AM
  4. How I can return an object?
    By CFW in forum New To Java
    Replies: 4
    Last Post: 01-14-2009, 11:54 AM
  5. how to return an object from an arraylist
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 07:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •