<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
    比較難的一部分

    前提條件:
    axis安裝路徑 C:\ericsson\javaextend\axis-1_4
    項目名稱:axisdemo
    已經有的類:com.service.myService.java
    配置文件:server-config.wsdd

    1. 在項目添加java2wsdl目錄

    2.目錄下面添加build.xml文件
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="Generate WSDL from JavaBeans as Web Services" default="j2w-all" basedir=".">
        
    <property name="build.dir" value="../build/classes" />
        
    <property name="axis.dir" location="C:\ericsson\javaextend\axis-1_4" />
        
    <path id="classpath.id">
            
    <fileset dir="${axis.dir}/lib">
                
    <include name="*.jar" />
            
    </fileset>
            
    <pathelement location="${build.dir}" />
        
    </path>
        
    <taskdef name="axis-java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask" loaderref="axis">
            
    <classpath refid="classpath.id" />
        
    </taskdef>
        
    <target name="j2w-all">
            
    <antcall target="j2w-JavaBeanWS" />
        
    </target>
        
    <target name="j2w-JavaBeanWS">
            
    <axis-java2wsdl classname="com.service.myService" classpath="${build.dir}" methods="getusername" output="myService.wsdl" location="http://localhost:8080/axisdemo/services/myService" namespace="http://localhost:8080/axisdemo/services/myService" namespaceImpl="http://localhost:8080/axisdemo/services/myService">
            
    </axis-java2wsdl>
        
    </target>
    </project>
    注意:build.dir / axis.dir / j2w-javabeanws幾個地方的內容要修改。

    3. 右鍵點擊build.xml,運行ant,就可以看到生成了myService.wsdl

    4.現在要把這個wsdl轉化成為java,新建目錄:wsdl2java

    5. 新建一個build.xml,內容:
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="wsclient" default="all" basedir=".">
        
    <property name="axis.home" location="C:\ericsson\javaextend\axis-1_4" />
        
    <property name="options.output" location="../wsdl2java" />
        
    <path id="axis.classpath">
            
    <fileset dir="${axis.home}/lib">
                
    <include name="**/*.jar" />
            
    </fileset>
        
    </path>
        
    <taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />
        
    <target name="-WSDL2Axis" depends="init">
            
    <mkdir dir="${options.output}" />
            
    <axis-wsdl2java output="${options.output}" url="${options.WSDL-URI}" verbose="true" />
        
    </target>
        
    <target name="init">
            
    <echo>Warning: please update the associated WSDL file(s) in the folder wsdl before running the target!</echo>
            
    <echo>Warning: Just run the target(s) related with your developing work!</echo>
            
    <echo>
            
    </echo>
        
    </target>
        
    <target name="all">
            
    <antcall target="myService" />
        
    </target>
        
    <target name="myService">
            
    <antcall target="-WSDL2Axis">
                
    <param name="options.WSDL-URI" location="../java2wsdl/myService.wsdl" />
            
    </antcall>
        
    </target>
    </project>
    注意修改的地方:axis.home

    6.build ant,在wsdl2java目錄下面多出來了4個類:
    myService.java
    MyServiceService.java
    myServiceServiceLocator.java
    MyServiceSoapBindingStub.java
    全部拷貝到src目錄下面

    7.在src目錄下面添加類:
    package com.axistest;

    import localhost.axisdemo.services.myService.MyService;
    import localhost.axisdemo.services.myService.MyServiceServiceLocator;

    public class myServiceTestorByStubs
    {
        
    public static void main(String[] args) throws Exception
        {
            MyServiceServiceLocator Service 
    = new MyServiceServiceLocator();
            MyService port 
    = Service.getmyService();
            String response 
      port.getusername(鄒萍");
            System.out.println(response);
        }
    }

    8.最后運行java application就完成了


    posted on 2008-12-18 11:03 張辰 閱讀(384) 評論(0)  編輯  收藏 所屬分類: Dr. Oops
    主站蜘蛛池模板: 亚洲国产精品无码久久九九| 女人18毛片水真多免费看| 免费观看理论片毛片| 亚洲人成777在线播放| 100部毛片免费全部播放完整| 亚洲AV无码专区国产乱码4SE | 亚洲依依成人亚洲社区| www.黄色免费网站| 亚洲黄色网址在线观看| 97视频免费在线| 亚洲一线产区二线产区区| 国产片免费福利片永久| av午夜福利一片免费看久久| 亚洲一区二区三区自拍公司| 鲁丝片一区二区三区免费| 亚洲五月六月丁香激情| 一个人免费观看在线视频www| 亚洲国产成人综合精品| 亚洲精品国自产拍在线观看| a视频在线免费观看| 亚洲五月六月丁香激情| 免费看美女让人桶尿口| 全部在线播放免费毛片| 国产亚洲精AA在线观看SEE| 18女人腿打开无遮掩免费| 日韩亚洲产在线观看| 亚洲精品tv久久久久久久久久| 中文字幕乱码免费看电影| 亚洲视频日韩视频| 日韩成人在线免费视频 | 亚洲欧美在线x视频| 亚洲一区日韩高清中文字幕亚洲| 你懂的网址免费国产| 亚洲成人福利在线| 亚洲精品第一国产综合精品99| 国产午夜无码精品免费看动漫| 国产亚洲精品影视在线| 浮力影院亚洲国产第一页| 国内精自视频品线六区免费| 美女黄网站人色视频免费| 久久久久亚洲精品天堂|