使用netbeans开发的Web服务 - 如何在Web服务程序中返回java类的对象

时间:2012-03-21 06:02:58

标签: java web-services netbeans axis2

我使用Netbeans IDE for Java开发了Axis2 Web服务。我想从Web服务程序返回类型为java.lang.Process类的对象。我已经成功地将它部署在GlassFish服务器中,但是当我尝试通过编写客户端来使用Web服务时,返回类型显示为Object。如何捕获从Web服务返回的确切类型?

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) {
      //
   }
}

0 个答案:

没有答案