當前位置:編程學習大全網 - 網站源碼 - 如何使用java做webservice

如何使用java做webservice

基於AXIS的web service: 1 比如要建壹個Server.java類的web service public class Server { public String printInfo(String name){ return "Hello,"+name; } } 2 把Server.java改為Server.Jws放到 …\Tomcat 5.5\webapps\axis中,重啟服務器 3 訪問 4 在cmd中輸入 cd D:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF 輸入命令:Java -Djava.ext.dirs=lib org.apache.axis.wsdl.WSDL2Java 5 找到…\Tomcat 5.5\webapps\axis\WEB-INF下生成的localhost文件夾復制到工程中 6 建壹個Client端的類進行測試: public class Client { public static void main(String arg[]) throws ServiceException, RemoteException{ ServerService ss=new ServerServiceLocator(); Server s=ss.getServer(); System.out.println("............"+s.printInfo("shiyou")); } }藍屏

  • 上一篇:51單片機 串口接收數據 十進制
  • 下一篇:修改別人的軟件源碼,然後自己再打包上傳到市場可以嗎?會不會犯法
  • copyright 2024編程學習大全網