<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Terry.Li-彬

    虛其心,可解天下之問;專其心,可治天下之學;靜其心,可悟天下之理;恒其心,可成天下之業。

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      143 隨筆 :: 344 文章 :: 130 評論 :: 0 Trackbacks
    我比較懶惰,不想把user guide全部翻譯,就記錄一些點吧。
      
      Axis2是全新設計的,在2004年的“Axis峰會”上,大家決定采用新的架構來讓Axis更加的富有彈性,更有效率,并且更加的可配置。Axis2現在具有的一些feature:
      Speed
      Low memory foot print
      AXIOM - AXis Object Model
      Hot Deployment
      Asynchronous Web Services
      MEP Support - Message Exchange Patterns
      Flexibility
      Stability
      Component-oriented deployment
      Transport framework
      WSDL support
      
      有些feature現在看不懂,還是先動手做一下,感性認識一下吧
      
      第一步:下載AXIS2。http://ws.apache.org/axis2/download.cgi。很有趣,在apache的Web Service 的Project目錄下面還看不到AXIS2。要下那個binary的版本,因為里面有例程。
      
      第二步:Copy axis2.war到$TOMCAT_HOME/webapps目錄下面。Tomcat好像只能用JDK1.4,我在JDK1.5 用不出來。
      
      第三步:打開 http://localhost:8080/axis2,就可以看到axis2的Welcome頁面了。點一下Validate 和Services,看是不是都沒有錯誤。都沒有錯誤的話,就表示deploy成功了。那個adminstration頁面可以通過上傳文件來hot deploy Web service,可以用來remote deploy。
      
      第四步:研究例程。先從"samples/userguide/src"目錄下的例程看起。看到寫一個web service很簡單嘛:
      
      public class MyService {
      public OMElement echo(OMElement element) throws XMLStreamException {
      //Praparing the OMElement so that it can be attached to another OM Tree.
      //First the OMElement should be completely build in case it is not fully built and still
      //some of the xml is in the stream.
      element.build();
      //Secondly the OMElement should be detached from the current OMTree so that it can be attached
      //some other OM Tree. Once detached the OmTree will remove its connections to this OMElement.
      element.detach();
      return element;
      }
      
      public void ping(OMElement element) throws XMLStreamException {
      //Do some processing
      }
      public void pingF(OMElement element) throws AxisFault{
      throw new AxisFault("Fault being thrown");
      }
      }
      
      看得出來,函數統一使用OMElement作為參數。在META-INF目錄下面有個services.xml文件:
      <service name="MyService">
      <description>
      This is a sample Web Service with two operations,echo and ping.
      </description>
      <parameter name="ServiceClass" locked="false">userguide.example1.MyService</parameter>
      <operation name="echo">
      <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
      </operation>
      <operation name="ping">
      <messageReceiver class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
      </operation>
      </service>
      呵呵,也很簡單嘛。有返回值的就用RawXMLINOutMessageReceiver,沒返回值的就用RawXMLINOnlyMessageReceiver。把它們編譯(要把axis2的jar寫到classpath里去)打包壓到 MyService.aar,包里文件目錄如下:
      ./\META-INF/services.xml
      ./userguide/example1/MyService.class
      把MyService.aar拷貝到$TOMCAT_HOME/webapps/axis2/WEB-INF/services,然后去點一下http://localhost:8080/axis2頁面上的Services,也就是http://localhost:8080/axis2/listServices.jsp,就可以看到MyService已經被列出來了。
      
      關于調用web service的東西蠻多,下次寫吧。
    posted on 2007-11-21 18:07 禮物 閱讀(416) 評論(0)  編輯  收藏 所屬分類: web service
    主站蜘蛛池模板: 美女黄频a美女大全免费皮| 日韩免费人妻AV无码专区蜜桃| 亚洲日韩在线第一页| 久久精品电影免费动漫| 久久亚洲精品国产亚洲老地址| 国产免费av片在线无码免费看 | 激情内射亚洲一区二区三区爱妻 | 免费jlzzjlzz在线播放视频| 国产在线观看免费视频软件| 亚洲AV一二三区成人影片| 亚洲精品成人a在线观看| 99久久免费国产香蕉麻豆| 免费一区二区三区在线视频| 久久亚洲国产精品成人AV秋霞 | 亚洲AV第一页国产精品| 国产美女精品久久久久久久免费| 在线播放免费人成毛片乱码| 亚洲AV无码专区在线电影成人 | 亚洲香蕉久久一区二区三区四区| 亚洲日韩国产精品乱| 久久WWW色情成人免费观看| 99精品免费视品| 爱情岛亚洲论坛在线观看| 在线观看亚洲一区二区| 中文字幕人成人乱码亚洲电影| 97在线线免费观看视频在线观看| 免费人成在线观看视频高潮| 免费在线观看亚洲| 亚洲精品人成网在线播放影院| 亚洲av午夜福利精品一区人妖| 亚洲国产黄在线观看| 日韩成人免费aa在线看| 69式互添免费视频| 免费观看久久精彩视频| jizz免费在线影视观看网站| 亚洲av永久无码| 亚洲AV成人影视在线观看| 亚洲五月激情综合图片区| 亚洲精品国产精品乱码不卡√ | 亚洲综合丁香婷婷六月香| 色婷婷六月亚洲婷婷丁香|