夢幻之旅

          DEBUG - 天道酬勤

             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            671 隨筆 :: 6 文章 :: 256 評論 :: 0 Trackbacks
          <2010年7月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          公告

          本博客中未注原創的文章均為轉載,對轉載內容可能做了些修改和增加圖片注釋,如果侵犯了您的版權,或沒有注明原作者,請諒解

          常用鏈接

          留言簿(21)

          隨筆分類(644)

          隨筆檔案(669)

          文章檔案(6)

          最新隨筆

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          接口:

          package test;

          public interface IHelloWorld
          {   
              
          public String sayHello(String name);
          }

          接口實現類:

          package test;


          public class HelloWorldImpl implements IHelloWorld
          {

              
          public String sayHello(String name)
              
          {
                  
          return name + "say: Hello world!";
              }
             

          }


          測試類
          package test;

          import java.net.URL;

          import org.codehaus.xfire.client.Client;


          public class TestCanUse
          {   
              
          public static void main(String[] args) throws Exception 
               Client client 
          = new Client(new 
               URL(
          "http://localhost:8080/services/abc?wsdl")); 
               Object[] results 
          = client.invoke("sayHello"new Object[] {"Huyvanpull"}); 
               System.out.println((String) results[
          0]);
              }

          }


          配置:
          <?xml version="1.0" encoding="GBK"?>
          <beans xmlns="http://xfire.codehaus.org/config/1.0">
              
          <service>
                  
          <name>abc</name>
                  
          <namespace>http://localhost:8080/services/hello</namespace>
                  
          <serviceClass>test.IHelloWorld</serviceClass>
                  
          <implementationClass>test.HelloWorldImpl</implementationClass>
              
          </service>
          </beans>
          posted on 2010-07-22 14:54 HUIKK 閱讀(143) 評論(0)  編輯  收藏 所屬分類: Java
          主站蜘蛛池模板: 定远县| 仁怀市| 郸城县| 新宾| 兴海县| 利辛县| 洛川县| 闵行区| 大足县| 平罗县| 黔西县| 西贡区| 柯坪县| 左权县| 陈巴尔虎旗| 邵阳市| 金溪县| 乌兰浩特市| 临海市| 湘西| 施秉县| 晋江市| 黎城县| 金塔县| 通许县| 巨鹿县| 秭归县| 福海县| 茶陵县| 亚东县| 德兴市| 博白县| 麻阳| 东丽区| 东至县| 樟树市| 淮阳县| 湖北省| 武城县| 东山县| 南京市|