夢幻之旅

          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 閱讀(145) 評論(0)  編輯  收藏 所屬分類: Java
          主站蜘蛛池模板: 湘阴县| 塘沽区| 小金县| 孙吴县| 丰宁| 栖霞市| 柳州市| 湟中县| 扬中市| 吉林省| 望奎县| 开化县| 光泽县| 新余市| 庆元县| 云霄县| 五原县| 碌曲县| 十堰市| 鄱阳县| 景谷| 麟游县| 深圳市| 杨浦区| 商洛市| 凤台县| 牟定县| 柳林县| 靖西县| 疏勒县| 井研县| 奈曼旗| 安阳市| 兴安县| 旬阳县| 英超| 汾西县| 勃利县| 九江市| 花垣县| 海南省|