以文本方式查看主题

-  W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWL  (http://bbs.xml.org.cn/index.asp)
--  『 Web Services & Semantic Web Services 』  (http://bbs.xml.org.cn/list.asp?boardid=10)
----  初学者axis服务有关问题~~~急~~~  (http://bbs.xml.org.cn/dispbbs.asp?boardid=10&rootid=&id=46665)


--  作者:zengchuanli00
--  发布时间:5/10/2007 9:55:00 AM

--  初学者axis服务有关问题~~~急~~~
我的毕业设计是导师要我做一个在局域内可以通过其它机子访问我机发布的服务。以此获取我机的系统属性,我先在我机子上布属服务获取系统属性并保存到Properties类中然后在返回到客户端调用的类中,但是执行时老是服务器端发布的服务编译报错,具体代码如下,还恳请各位高手指点~~~~

这是客户端:

//package com.hongsoft.test;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import javax.xml.namespace.QName;
import java.util.Properties;

public class GetClient
{
   public static void main(String [] args) {
       try {
           
     String endpoint="http://localhost:8080/axis/getSystemProperty.jws";
     
           Service  service = new Service();
           Call     call    = (Call) service.createCall();

           call.setTargetEndpointAddress( new java.net.URL(endpoint) );
           //call.setOperationName(new QName("echoString") );
           call.setOperationName(new QName("getName") );
           
           Properties ret = (Properties) call.invoke( new Object[] {} );

           ret.list(System.out);
       } catch (Exception e) {
           System.err.println(e.toString());
       }
   }
}

服务器端:
mport java.util.Properties;

public class getSystemProperty {

    public  Properties getName (

            Properties prop = new Properties( System.getProperties() );
     
   retrun prop;
   }
}
结果报错:Error while compiling: D:\Sun\Tomcat5.0\webapps\axis\WEB-INF\jwsClassesgetSystemProperty.java



--  作者:timothy
--  发布时间:5/10/2007 9:00:00 PM

--  
大哥,你毕业设计就做这个!!!

你上面那个类写错了,尽是些语法错误,怎么不报错啊 !!!!
import java.util.Properties;

public class getSystemProperty {

    public  Properties getName (){

            Properties prop=  new Properties( System.getProperties() );
     
       return prop;
    }
}
你把服务部署到axis中,请您先用jdk编译一下,把语法之类的错误断了先!!!!

不过还是鼓励你!!加油!


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.500ms