title: Web Services developed using netbeans - how to return objects of java classes in a web service program
body: <p>I've developed a Axis2 web service using Netbeans IDE for Java. I want to return an object of type <code>java.lang.Process</code> class from the web service program. I have deployed it in the GlassFish server successfully but when I try to consume the web service by writing a client, the return type is shown as Object. How do I capture the exact type returned from the web service?</p>
  
  <pre><code>public Process comp(String filename, String filecontent) {
     Process p = null;
     Runtime rt = Runtime.getRuntime();
     String msg = "";
     String command[] = new String[4];
     command[0] = "cmd";
     command[1] = "/C";
     command[2] = "javac";
     command[3] = filename;
     String envp[] = new String[1];
     envp[0] = "path=C:/Program Files (x86)/Java/jdk1.6.0/bin";
     File dir = new File("Path to file");
     try {
        FileWriter writer = new FileWriter(jfile);
        writer.append(filecontent);
        writer.close();
        p = rt.exec(command, envp, dir);
        return p;
     } catch (Exception e) {
        //
     }
  }
  </code></pre>