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

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

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

    posts - 32,comments - 8,trackbacks - 0

    reference:

    http://www.cnblogs.com/cy163/archive/2008/11/28/1343516.html

    pre-condition:
    1.install eclipse
    2.install tomcat plugin

    process:
    1.download axis lib: http://ws.apache.org/axis

    2. set classpath:
    1.AXIS_HOME
    D:\Java\axis-1_4(這是我的Axis路徑)
    2.AXIS_LIB
    %AXIS_HOME%\lib
    3.AXIS_CLASSPATH
    %AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery-0.2.jar;%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\xml-apis.jar;%AXIS_LIB%\xercesImpl.jar;%AXIS_LIB%\wsdl4j-1.5.1.jar;%AXIS_LIB%\activation.jar;%AXIS_LIB%\xmlrpc-2.0.jar
    4.CLASSPATH
    .;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar; %AXIS_CLASSPATH%;
    5.在你的%TOMCAT_HOME%\common\lib下需要加入三個包 activation.jar、mail.jar、tools.jar,注意這三個包是必須的,盡管tools.jar很常見,但這也是運行Axis所必須的包。


    3.FIle - new - dynamic web project
    projectname: oopsaxis1
    target runtime: apache tomcat V5.5


    4. oopsaxis1/WebContent/WEB-INF/lib,add lib from %AXIS_HOME%\lib
    axis.jar/axis-ant.jar/commons-log.jar...

    5.oopsaxis1/WebContent/WEB-INF/web.xml,  replace by %AXIS_HOME%\webapps\axis\WEB-INF\web.xml

    6.oopsaxis1/src, add java file:
    public class myService
    {
        
    public String getusername(String name)
        {
            
    return "Hello " + name + ",this is an Axis DII Web Service";
        }
    }


    7.copy myService to oopsaxis1/WebContent, and rename to myService.jws

    8. right click myService.jws, run as - run on server, you can see:
    http://localhost:8080/oopsaxis1/myService.jws
    There is a Web Service here
    Click to see the WSDL 
    click the link, you can see the wsdl


    9. in eclipse - package explorer - src, new class:
    package com.oopsaxis;

    import java.net.MalformedURLException;
    import java.rmi.RemoteException;

    import javax.xml.rpc.ParameterMode;
    import javax.xml.rpc.ServiceException;

    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;

    public class myServiceTestorByjws
    {
        
    public static void main(String[] args) throws ServiceException,
                MalformedURLException, RemoteException
        {
            String endpoint 
    = http://localhost:8080/oopsaxis1/myService.jws;
            String name 
    = " pixysoft";
            Service service 
    = new Service();
            Call call 
    = (Call) service.createCall();

            call.setTargetEndpointAddress(
    new java.net.URL(endpoint));
            call.addParameter(
    "param1", XMLType.XSD_STRING, ParameterMode.IN);
            call.setOperationName(
    "getusername");
            call.setReturnType(XMLType.XSD_STRING);
            String ret 
    = (String) call.invoke(new Object[] { name });
            System.out.println(
    "返回結果:" + ret);
        }
    }

    10. right click myServiceTestorByjws, run as java application,you get:
    返回結果:Hello pixysoft,this is an Axis DII Web Service

    done!
    posted on 2008-12-17 13:40 張辰 閱讀(267) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 免费观看激色视频网站(性色)| 中文在线免费不卡视频| 国产91色综合久久免费分享| 亚洲av日韩av激情亚洲| 久久久受www免费人成| 亚洲国产成人久久综合一区77| 日韩亚洲翔田千里在线| 日本无卡码免费一区二区三区| 亚洲а∨精品天堂在线| 国产在线19禁免费观看| 免费一级全黄少妇性色生活片| 国产一级淫片视频免费看| 一级午夜免费视频| 亚洲国产a∨无码中文777| 久久久久久一品道精品免费看| 亚洲黄网在线观看| 中文字幕无码成人免费视频| 国产v亚洲v天堂a无| 国产在线ts人妖免费视频| 一区二区三区在线免费| 亚洲AV无码一区二区二三区软件 | 成人毛片免费观看视频大全| 亚洲色丰满少妇高潮18p| 手机看片久久国产免费| 成人精品综合免费视频| 亚洲AV无码码潮喷在线观看| 无码日韩精品一区二区免费暖暖| 亚洲国产精品综合福利专区| 全免费A级毛片免费看网站| 日韩精品无码永久免费网站| 亚洲成a人片在线观看日本| 黄瓜视频高清在线看免费下载| 精品国产日韩亚洲一区91| 亚洲人成中文字幕在线观看| 51视频精品全部免费最新| 日韩色日韩视频亚洲网站| 亚洲午夜国产精品无码老牛影视 | 亚洲日韩精品A∨片无码| 亚欧免费视频一区二区三区| 美女被免费网站在线视频免费| 久久亚洲国产中v天仙www |