module ice {
interface Printer
{
  void printString(string s);
};
};我写了一个slice的脚本,里面的printString方法只能传送String,要传送Object要怎么办?

解决方案 »

  1.   

    晕,找到解决办法了。只要在里面加个想传送的类型就行了。
    module com{ 
    module test{class ShutdownRecord{
    string id;
    string name;};interface RemoteShutdown 
    {
       bool saveShutdownRecord(ShutdownRecord record);
       bool sendMessage(string msg);
    };
    };
    };
      

  2.   

    ICE开发步聚大概如下
    1.编写一个后缀为ice的文件
    test.ice文件内容如下
    module test {
    interface Printer
    {
      void printString(string s);
    };
    };2.打开命令行,输入D:\temp>"d:\Ice-3.3.0\bin\slice2java" test.ice
    3.把生成的类放到项目即可