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

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

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

    隨筆 - 312, 文章 - 14, 評(píng)論 - 1393, 引用 - 0
    數(shù)據(jù)加載中……

    WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService

    本文為原創(chuàng),如需轉(zhuǎn)載,請(qǐng)注明作者和出處,謝謝!

        Axis2是一套嶄新的WebService引擎,該版本是對(duì)Axis1.x重新設(shè)計(jì)的產(chǎn)物。Axis2不僅支持SOAP1.1SOAP1.2,還集成了非常流行的REST WebService,同時(shí)還支持SpringJSON等技術(shù)。這些都將在后面的系列教程中講解。在本文中主要介紹了如何使用Axis2開(kāi)發(fā)一個(gè)不需要任何配置文件的WebService,并在客戶端使用JavaC#調(diào)用這個(gè)WebService

    一、Axis2的下載和安裝

        讀者可以從如下的網(wǎng)址下載Axis2的最新版本:

        http://ws.apache.org/axis2/

        在本文使用了目前Axis2的最新版本1.4.1。讀者可以下載如下兩個(gè)zip包:

        axis2-1.4.1-bin.zip

        axis2-1.4.1-war.zip

        其中axis2-1.4.1-bin.zip文件中包含了Axis2中所有的jar文件, axis2-1.4.1-war.zip文件用于將WebService發(fā)布到Web容器中。

        axis2-1.4.1-war.zip文件解壓到相應(yīng)的目錄,將目錄中的axis2.war文件放到<Tomcat安裝目錄>\webapps目錄中(本文使用的Tomcat的版本是6.x),并啟動(dòng)Tomcat

        在瀏覽器地址欄中輸入如下的URL

        http://localhost:8080/axis2/

        如果在瀏覽器中顯示出如圖1所示的頁(yè)面,則表示Axis2安裝成功。



    圖1

    二、編寫和發(fā)布WebService

      對(duì)于用Java實(shí)現(xiàn)的服務(wù)程序給人的印象就是需要進(jìn)行大量的配置,不過(guò)這一點(diǎn)在Axis2中將被終結(jié)。在Axis2中不需要進(jìn)行任何的配置,就可以直接將一個(gè)簡(jiǎn)單的POJO發(fā)布成WebService。其中POJO中所有的public方法將被發(fā)布成WebService方法。

        下面我們來(lái)實(shí)現(xiàn)一個(gè)簡(jiǎn)單的POJO,代碼如下:

    public class SimpleService
    {
        
    public String getGreeting(String name)
        {
            
    return "你好 " + name;
        }    
        
    public int getPrice()
        {
            
    return new java.util.Random().nextInt(1000);
        }    
    }

        SimpleService類中有兩個(gè)方法,由于這兩個(gè)方法都是public方法,因此,它們都將作為WebService方法被發(fā)布。

        編譯SimpleService類后,將SimpleService.class文件放到<Tomcat安裝目錄>\webapps\axis2\WEB-INF\pojo目錄中(如果沒(méi)有pojo目錄,則建立該目錄)。現(xiàn)在我們已經(jīng)成功將SimpleService類發(fā)布成了WebService。在瀏覽器地址欄中輸入如下的URL

    http://localhost:8080/axis2/services/listServices

        這時(shí)當(dāng)前頁(yè)面將顯示所有在Axis2中發(fā)布的WebService,如圖2所示。



    圖2

        在瀏覽器地址欄中輸入如下的兩個(gè)URL來(lái)分別測(cè)試getGreetinggetPrice方法:

    http://localhost:8080/axis2/services/SimpleService/getGreeting?name=bill

    http://localhost:8080/axis2/services/SimpleService/getPrice

        3和圖4分別顯示了getGreetinggetPrice方法的測(cè)試結(jié)果。

    圖3  getGreeting方法的測(cè)試結(jié)果

    圖4  getPrice方法的測(cè)試結(jié)果

        在編寫、發(fā)布和測(cè)試0配置的WebService時(shí)應(yīng)注意如下幾點(diǎn):

        1. POJO類不能使用package關(guān)鍵字聲明包。

        2. Axis2在默認(rèn)情況下可以熱發(fā)布WebService,也就是說(shuō),將WebService.class文件復(fù)制到pojo目錄中時(shí),Tomcat不需要重新啟動(dòng)就可以自動(dòng)發(fā)布WebService。如果想取消Axis2的熱發(fā)布功能,可以打開(kāi)<Tomcat安裝目錄>\webapps\axis2\WEB-INF\conf\axis2.xml,找到如下的配置代碼:

    <parameter name="hotdeployment">true</parameter>

        true改為false即可。要注意的是,Axis2在默認(rèn)情況下雖然是熱發(fā)布,但并不是熱更新,也就是說(shuō),一旦成功發(fā)布了WebService,再想更新該WebService,就必須重啟Tomcat。這對(duì)于開(kāi)發(fā)人員調(diào)試WebService非常不方便,因此,在開(kāi)發(fā)WebService時(shí),可以將Axis2設(shè)為熱更新。在axis2.xml文件中找到<parameter name="hotupdate">false</parameter>,將false改為true即可。

        3. 在瀏覽器中測(cè)試WebService時(shí),如果WebService方法有參數(shù),需要使用URL的請(qǐng)求參數(shù)來(lái)指定該WebService方法參數(shù)的值,請(qǐng)求參數(shù)名與方法參數(shù)名要一致,例如,要測(cè)試getGreeting方法,請(qǐng)求參數(shù)名應(yīng)為name,如上面的URL所示。

        4. 發(fā)布WebServicepojo目錄只是默認(rèn)的,如果讀者想在其他的目錄發(fā)布WebService,可以打開(kāi)axis2.xml文件,并在<axisconfig>元素中添加如下的子元素:

        <deployer extension=".class" directory="my" class="org.apache.axis2.deployment.POJODeployer"/>

        上面的配置允許在<Tomcat安裝目錄>\webapps\axis2\WEB-INF\my目錄中發(fā)布WebService。例如,將本例中的SimpleService.class復(fù)制到my目錄中也可以成功發(fā)布(但要?jiǎng)h除pojo目錄中的SimpleService.class,否則WebService會(huì)重名)。

    三、 Java實(shí)現(xiàn)調(diào)用WebService的客戶端程序

        WebService是為程序服務(wù)的,只在瀏覽器中訪問(wèn)WebService是沒(méi)有意義的。因此,在本節(jié)使用Java實(shí)現(xiàn)了一個(gè)控制臺(tái)程序來(lái)調(diào)用上一節(jié)發(fā)布的WebService。調(diào)用WebService的客戶端代碼如下:

    package client;

    import javax.xml.namespace.QName;
    import org.apache.axis2.addressing.EndpointReference;
    import org.apache.axis2.client.Options;
    import org.apache.axis2.rpc.client.RPCServiceClient;

    public class RPCClient
    {
        
    public static void main(String[] args) throws Exception  
        {
            
    //  使用RPC方式調(diào)用WebService        
            RPCServiceClient serviceClient = new RPCServiceClient();
            Options options 
    = serviceClient.getOptions();
            
    //  指定調(diào)用WebService的URL
            EndpointReference targetEPR = new EndpointReference(
                    
    "http://localhost:8080/axis2/services/SimpleService");
            options.setTo(targetEPR);
            
    //  指定getGreeting方法的參數(shù)值
            Object[] opAddEntryArgs = new Object[] {"超人"};
            
    //  指定getGreeting方法返回值的數(shù)據(jù)類型的Class對(duì)象
            Class[] classes = new Class[] {String.class};
            
    //  指定要調(diào)用的getGreeting方法及WSDL文件的命名空間
            QName opAddEntry = new QName("http://ws.apache.org/axis2""getGreeting");
            
    //  調(diào)用getGreeting方法并輸出該方法的返回值
            System.out.println(serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, classes)[0]);
            
    //  下面是調(diào)用getPrice方法的代碼,這些代碼與調(diào)用getGreeting方法的代碼類似
            classes = new Class[] {int.class};
            opAddEntry 
    = new QName("http://ws.apache.org/axis2""getPrice");
            System.out.println(serviceClient.invokeBlocking(opAddEntry, 
    new Object[]{}, classes)[0]);
        } 
    }

    運(yùn)行上面的程序后,將在控制臺(tái)輸出如下的信息:


    你好 超人
    443

        在編寫客戶端代碼時(shí)應(yīng)注意如下幾點(diǎn):

        1. 客戶端代碼需要引用很多Axis2jar包,如果讀者不太清楚要引用哪個(gè)jar包,可以在Eclipse的工程中引用Axis2發(fā)行包的lib目錄中的所有jar包。

        2. 在本例中使用了RPCServiceClient類的invokeBlocking方法調(diào)用了WebService中的方法。invokeBlocking方法有三個(gè)參數(shù),其中第一個(gè)參數(shù)的類型是QName對(duì)象,表示要調(diào)用的方法名;第二個(gè)參數(shù)表示要調(diào)用的WebService方法的參數(shù)值,參數(shù)類型為Object[];第三個(gè)參數(shù)表示WebService方法的返回值類型的Class對(duì)象,參數(shù)類型為Class[]。當(dāng)方法沒(méi)有參數(shù)時(shí),invokeBlocking方法的第二個(gè)參數(shù)值不能是null,而要使用new Object[]{}

        3. 如果被調(diào)用的WebService方法沒(méi)有返回值,應(yīng)使用RPCServiceClient類的invokeRobust方法,該方法只有兩個(gè)參數(shù),它們的含義與invokeBlocking方法的前兩個(gè)參數(shù)的含義相同。

        4. 在創(chuàng)建QName對(duì)象時(shí),QName類的構(gòu)造方法的第一個(gè)參數(shù)表示WSDL文件的命名空間名,也就是<wsdl:definitions>元素的targetNamespace屬性值,下面是SimpleService類生成的WSDL文件的代碼片段:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd"
    xmlns:ns
    ="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
    xmlns:http
    ="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:mime
    ="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soap12
    ="http://schemas.xmlsoap.org/wsdl/soap12/"
    targetNamespace
    ="http://ws.apache.org/axis2"
    >
        
    <wsdl:types>
             
        
    </wsdl:types>
         
    </wsdl:definitions>

    四、用wsdl2java簡(jiǎn)化客戶端的編寫

        也許有很多讀者會(huì)說(shuō)“有沒(méi)有搞錯(cuò)啊,只調(diào)用兩個(gè)WebService方法用要寫這么多代碼,太麻煩了”。

        不過(guò)幸好Axis2提供了一個(gè)wsdl2java.bat命令可以根據(jù)WSDL文件自動(dòng)產(chǎn)生調(diào)用WebService的代碼。wsdl2java.bat命令可以在<Axis2安裝目錄>"bin目錄中找到。在使用wsdl2java.bat命令之前需要設(shè)置AXIS2_HOME環(huán)境變量,該變量值是<Axis2安裝目錄>

        Windows控制臺(tái)輸出如下的命令行來(lái)生成調(diào)用WebService的代碼:

    %AXIS2_HOME%\bin\wsdl2java -uri http://localhost:8080/axis2/services/SimpleService?wsdl -p client -s -o stub

        其中-url參數(shù)指定了wsdl文件的路徑,可以是本地路徑,也可以是網(wǎng)絡(luò)路徑。-p參數(shù)指定了生成的Java類的包名,-o參數(shù)指定了生成的一系列文件保存的根目錄。在執(zhí)行完上面的命令后,讀者就會(huì)發(fā)現(xiàn)在當(dāng)前目錄下多了個(gè)stub目錄,在."stub"src"client目錄可以找到一個(gè)SimpleServiceStub.java文件,該文件復(fù)雜調(diào)用WebService,讀者可以在程序中直接使用這個(gè)類,代碼如下:

    package client;

    import javax.xml.namespace.QName;
    import org.apache.axis2.addressing.EndpointReference;
    import org.apache.axis2.client.Options;
    import org.apache.axis2.rpc.client.RPCServiceClient;

    public class StubClient
    {
        
    public static void main(String[] args) throws Exception  
        {
            SimpleServiceStub stub 
    = new SimpleServiceStub();
            SimpleServiceStub.GetGreeting gg 
    = new SimpleServiceStub.GetGreeting();
            gg.setName(
    "比爾");
            System.out.println( stub.getGreeting(gg).get_return());
            System.out.println(stub.getPrice().get_return());
        } 
    }

        上面的代碼大大簡(jiǎn)化了調(diào)用WebService的步驟,并使代碼更加簡(jiǎn)潔。但要注意的是,wsdl2java.bat命令生成的Stub類將WebService方法的參數(shù)都封裝在了相應(yīng)的類中,類名為方法名,例如,getGreeting方法的參數(shù)都封裝在了GetGreeting類中,要想調(diào)用getGreeting方法,必須先創(chuàng)建GetGreeting類的對(duì)象實(shí)例。

    五、使用C#調(diào)用WebService

        從理論上說(shuō),WebService可以被任何支持SOAP協(xié)議的語(yǔ)言調(diào)用。在Visual Studio中使用C#調(diào)用WebService是在所有語(yǔ)言中最容易實(shí)現(xiàn)的(VB.net的調(diào)用方法類似,也同樣很簡(jiǎn)單)。

        新建一個(gè)Visual Studio工程,并在引用Web服務(wù)的對(duì)話框中輸入如下的URL,并輸入Web引用名為“WebService”:

        http://localhost:8080/axis2/services/SimpleService?wsdl

        然后引用Web服務(wù)的對(duì)話框就會(huì)顯示該WebService中的所有的方法,如圖5所示。



    圖5

        在完成上面的工作后,只需要如下三行C#代碼就可以調(diào)用getGreetinggetPrice方法,并顯示這兩個(gè)方法的返回值:

    WebService.SimpleService simpleService = new WSC.WebService.SimpleService();
    MessageBox.Show( simpleService.getGreeting(
    "比爾"));
    MessageBox.Show(simpleService.getPrice().@return.ToString());

        .net解析WSDL文件時(shí)直接將getGreeting方法的參數(shù)映射為String類型,因此,可以直接進(jìn)行傳值。
        從上面的調(diào)用過(guò)程可以看出,添加Web引用的過(guò)程就相當(dāng)于在Java中調(diào)用wsdl2java.bat自動(dòng)生成stub類的過(guò)程。只是在調(diào)用stub類時(shí)與C#有一定的區(qū)別,但從總體上來(lái)說(shuō),都大大簡(jiǎn)化了調(diào)用WebService的過(guò)程。

    下一篇:WebService大講堂之Axis2(2):復(fù)合類型數(shù)據(jù)的傳遞





    Android開(kāi)發(fā)完全講義(第2版)(本書(shū)版權(quán)已輸出到臺(tái)灣)

    http://product.dangdang.com/product.aspx?product_id=22741502



    Android高薪之路:Android程序員面試寶典 http://book.360buy.com/10970314.html


    新浪微博:http://t.sina.com.cn/androidguy   昵稱:李寧_Lining

    posted on 2009-01-02 17:17 銀河使者 閱讀(72507) 評(píng)論(108)  編輯  收藏 所屬分類: java 原創(chuàng)webservice

    評(píng)論共2頁(yè): 1 2 下一頁(yè) 

    評(píng)論

    # Pojo類如何使用import調(diào)用其他類文件  回復(fù)  更多評(píng)論   

    看了博主的文章,受益非淺。。。

    但是本人在博主文章的基礎(chǔ)之上作進(jìn)一步的學(xué)習(xí)的時(shí)候遇到了困難。
    如題
    Pojo類如何使用import調(diào)用其他類文件

    本人發(fā)現(xiàn)使用 import引進(jìn)其他包的時(shí)候,
    調(diào)用方法,之后就會(huì)出現(xiàn)下面的XML說(shuō)明

    <soapenv:Reason>
    <soapenv:Text xml:lang="en-US">unknown</soapenv:Text>
    </soapenv:Reason>

    望博主在Pojo類中,如何調(diào)用其他文件作下說(shuō)明 謝謝
    2009-01-19 04:30 | 加加

    # Pojo類如何使用import調(diào)用其他類文件  回復(fù)  更多評(píng)論   

    我主要是想要調(diào)用

    axis2文件目錄以外的文件。。。

    就像 我本來(lái)有一個(gè)JAVA程序,我想把它發(fā)布為WebService
    可是不想把它整個(gè)程序都放到axis2文檔目錄下
    只想用它的其中幾個(gè)公共類打包發(fā)布成WebService。。

    所以在這里就遇到困難了
    2009-01-19 05:30 | 加加

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @加加

    是這樣的,axis2實(shí)際上就是一個(gè)Web目錄,在該目錄中可以發(fā)布jsp、servlet,而webservice是依賴servlet來(lái)實(shí)現(xiàn)的,因此,也可以發(fā)布web service,當(dāng)然,可以將axis2改成其他的名子,如ws。如果想發(fā)布類,一般有兩種方法:

    1. 按著本文所述,直接放在pojo目錄或其他的發(fā)布目錄中。
    2. 將這些類放在axis2\WEB-INF\classes目錄中,然后使用service.xml文件進(jìn)行發(fā)布。這塊在后面的文章將詳細(xì)講解

    在axis2目錄有一些jar文件還需要帶的,否則使用axis2無(wú)法成功發(fā)布web service,當(dāng)然,axis2目錄中的jar文件并不是都需要,根據(jù)使用的功能需要不同的jar文件,不過(guò)為了簡(jiǎn)單,可以將所有的jar包都保留。不過(guò)這是在服務(wù)端,應(yīng)該沒(méi)什么關(guān)系。
    2009-01-19 08:37 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    在本系列的后續(xù)文章還會(huì)講到使用service.xml文件來(lái)發(fā)布webservice,這種方式比較好,除此之外,還會(huì)講到會(huì)話在web service中的應(yīng)用,以及如何跨服務(wù)共享會(huì)話(session),在c#、delphi中使用調(diào)用復(fù)雜的web service等。
    2009-01-19 08:39 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    很好,學(xué)習(xí)中。。。。。
    2009-02-05 10:38 | ziyoo

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    謝謝博主共享了這么有實(shí)用的東西,正在學(xué)習(xí)中...
    2009-02-16 16:48 | 游客ABC

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    您幸苦了!
    2009-02-22 10:37 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    問(wèn)下,一個(gè)完整項(xiàng)目中只發(fā)布部分功能成服務(wù),把這幾個(gè)類放到axis2文檔目錄下吧?但這些類如何調(diào)用項(xiàng)目中其他類啊???
    2009-02-23 14:16 | zhuyongjp

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @zhuyongjp
    被調(diào)用的類需要放在axis2目錄中的WEB-INF\lib目錄或WEB-INF\classes目錄中,這樣就可以調(diào)用了
    2009-02-23 14:46 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    謝謝,在請(qǐng)教下。如果項(xiàng)目中有些方法既要在內(nèi)部調(diào)用,又要提供對(duì)外服務(wù),那這些類應(yīng)該如何放置呢?
    2009-02-23 16:34 | zhuyongjp

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    這些類應(yīng)該放在WEB-INF\lib目錄或WEB-INF\classes目錄中,如果要在內(nèi)部使用,直接調(diào)用就可以了,如果在外部使用(如發(fā)布成WebService),建議你使用spring來(lái)處理,這樣只要在aar文件中放一個(gè)services.xml就可以了,直接可以將spring的裝配bean發(fā)布成webservice。
    你可以參考我的文章:
    http://www.tkk7.com/nokiaguy/archive/2009/nokiaguy/archive/2009/02/13/254499.html
    2009-02-23 16:46 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    博主!如果我所發(fā)布webservice類前面引用其它的第三方j(luò)ar包,那這些jar包應(yīng)該如何引用進(jìn)來(lái)?我是把那些jar包直接放到WEB-INF\lib目錄里了,沒(méi)有提示出錯(cuò)什么的,但生成的wsdl文件中都是element maxOccurs="unbounded“的語(yǔ)句,很多。不知道是怎么回事!望解決~
    2009-03-16 16:48 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @Christino
    用java或其他客戶端可以生成stub類并調(diào)用嗎?
    2009-03-16 17:11 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    我不清楚您說(shuō)的是什么意思?
    我要發(fā)布的Webservice方法前引用了第三方的jar包。說(shuō)的詳細(xì)些就是:我要把matlab的算法(方法)做成webservice來(lái)發(fā)布,但是其中要引用matlab一些相關(guān)的jar包.現(xiàn)在不清楚怎么才能成功的調(diào)用?請(qǐng)指教一下,謝謝!
    2009-03-17 16:09 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @Christino
    將第三方的包放在axis2\WEB-INF\lib目錄中,然后在webservice類中引用并調(diào)用相關(guān)的類就可以了,在客戶端調(diào)用沒(méi)什么區(qū)別。有什么問(wèn)題嗎?如果是正式發(fā)布的webservice,建議看看我后面的幾篇文章,建議使用services.xml文件來(lái)發(fā)布,而不要放在pojo里,這里面的類不能有package。
    2009-03-17 16:49 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    再請(qǐng)教一個(gè)問(wèn)題我所傳遞的參數(shù)有的是17520*10的二維數(shù)組,像您第二篇寫的那樣,這樣的參數(shù)就肯定不能傳遞嗎?謝謝!
    2009-03-17 16:49 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    多維數(shù)組axis2不支持,但可以使用對(duì)象數(shù)組,如聲明一個(gè)長(zhǎng)度為17520的數(shù)組,數(shù)組元素類型是一個(gè)對(duì)象,這個(gè)對(duì)象有一個(gè)類型為數(shù)組(長(zhǎng)度為10)的屬性。然后傳到服務(wù)器再轉(zhuǎn)換一下就可以了。
    2009-03-17 17:00 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    呵呵,對(duì),我就是用services.xml來(lái)發(fā)布的。非常,非常感謝您!我試試!
    2009-03-17 19:00 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    按照您的方法,我試了一下。我做了一個(gè)ArrayTemp類來(lái)承載這個(gè)二維數(shù)組,正如我上面所說(shuō),我要這個(gè)二維數(shù)組當(dāng)做參數(shù)傳遞到webservice類的方法,如public Object[] getWebFigure(String[] _nee, ArrayTemp[] arr)這種形式。但是在客戶端傳遞進(jìn)去的時(shí)候,報(bào)錯(cuò)說(shuō)ArrayTemp類型不匹配。如:getWebFigure.setArr(arr);,,,,所以是不是axis2中參數(shù)的數(shù)據(jù)類型只能是基本類型,像這種對(duì)象參數(shù)他不認(rèn)是不是?謝謝!
    2009-03-18 10:28 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @Christino
    按你的getWebFigure方法沒(méi)有錯(cuò)誤,我做了一個(gè)例子,完全沒(méi)問(wèn)題,可能是你設(shè)置的問(wèn)題,另外要注意,ArrayTemp的相應(yīng)屬性必須有g(shù)etter和setter方法,Axis2不會(huì)直接訪問(wèn)public的類字段,而是通過(guò)getter和setter方法來(lái)獲得和設(shè)置屬性值的。例子代碼如下:

    package service;

    public class ArrayTemp
    {
    public int[] values = new int[10];

    public int[] getValues()
    {
    return values;
    }
    public void setValues(int[] values)
    {
    this.values = values;
    }
    }

    // webservice類
    package service;

    public class ComplexTypeService
    {
    public ArrayTemp[] getWebFigure(String[] _nee, ArrayTemp[] arr)
    {
    System.out.println(_nee[0]);
    System.out.println(arr[0].values[0]);
    ArrayTemp t = new ArrayTemp();

    return new ArrayTemp[]{t};
    }
    }

    <!-- services.xml -->
    <service name="ComplexTypeService" >
    <Description>
    Please Type your service description here
    </Description>
    <messageReceivers>
    <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
    class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </messageReceivers>
    <parameter name="ServiceClass" locked="false">service.ComplexTypeService</parameter>
    </service>

    我用.net測(cè)試的,沒(méi)問(wèn)題,估計(jì)Java也不會(huì)有問(wèn)題。
    2009-03-18 12:22 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    但是我在客戶端傳arr對(duì)像數(shù)組時(shí),說(shuō)類型不匹配。getWebFigure.setArr(arr);->出錯(cuò)。說(shuō)setArr中的參數(shù)應(yīng)該是SpikeWebserviceStubArrayTemp[]類型,我的arr是ArrayTemp類型。其中SpikeWebserviceStub是用wsdl2java生成的Stub。按您后邊講的,我把ArrayTemp類放到了tomcat6.0\webapps\axis2\WEB-INF\classes\service\ArrayTemp.class中。是這個(gè)地方錯(cuò)了嗎。
    2009-03-18 14:57 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @Christino
    還要注意一點(diǎn),arr的類型不能是ArrayTemp[],必須為Stub類所帶的相應(yīng)類型,也就是SpikeWebserviceStub.ArrayTemp[],所以會(huì)出現(xiàn)不匹配。

    SpikeWebserviceStub.ArrayTemp[] arr = new SpikeWebserviceStub.ArrayTemp[]{...};
    getWebFigure.setArr(arr);

    這才正確!
    2009-03-18 15:48 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    明白!真的很感謝您花這么多寶貴的時(shí)間來(lái)指點(diǎn)我這個(gè)菜鳥(niǎo),由衷的感謝!
    2009-03-18 16:03 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    這幾天刷您的博客已經(jīng)成為我的習(xí)慣了呵呵!
    2009-03-18 16:07 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @Christino
    哈哈,受寵若驚啊!
    這也正體現(xiàn)了互聯(lián)網(wǎng)的精神:人人為我,我為人人!!
    2009-03-18 18:44 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    您的方法是直接把.aar文件放到services文件夾里,從而生成.wsdl文件。那我怎么才能修改.wsdl文件啊?
    2009-03-19 15:17 | Christino

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @Christino
    修改wsdl文件?一種方法是在服務(wù)端先生成一個(gè)wsdl文件,然后放到META-INF目錄中,或直接通過(guò)url由客戶端根據(jù)wsdl生成Stub類,wsdl只用于客戶端生成Stub類,是靜態(tài)的或動(dòng)態(tài)的都可以。當(dāng)修改webservice類時(shí),wsdl會(huì)自動(dòng)改變的(動(dòng)態(tài)方式)。
    2009-03-19 15:27 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    建議還是使用動(dòng)態(tài)生成wsdl的方式,靜態(tài)的我也沒(méi)用過(guò),不太喜歡靜態(tài)的方式
    2009-03-19 15:28 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    你好,我照您的例子做了,0配置什么都對(duì),但結(jié)果如下,出現(xiàn)了空值!不知什么原因?getPrice方法正確!!<ns:getGreetingResponse xmlns:ns="http://ws.apache.org/axis2">
    <return>hellonull</return>
    </ns:getGreetingResponse>
    2009-04-09 11:07 | success2008

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @success2008
    你這程序用什么測(cè)的,是直接在瀏覽器中測(cè)試的,還是使用本文的客戶端程序?
    2009-04-09 11:43 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    我遇到了同樣的問(wèn)題.
    在瀏覽器中測(cè)試
    無(wú)論傳入什么參數(shù)總是 出現(xiàn)
    - <ns:getGreetingResponse xmlns:ns="http://ws.apache.org/axis2">
    <return>你好 null</return>
    </ns:getGreetingResponse>
    2009-04-11 23:33 | ajax

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @ajax
    你在瀏覽器中輸入的url是什么,發(fā)上來(lái)看看
    2009-04-13 08:31 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    我也是,原因是wsdl自動(dòng)生成后,參數(shù)是<xs:element minOccurs="0" name="param0" nillable="true" type="xs:string"/>
    名字變成了param0,所以要變成http://localhost:8080/axis2/services/SimpleService/getGreeting?param0=bill,不知道在生成wsdl時(shí)指定參數(shù)名字
    2009-04-13 14:52 | gp0014

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @gp0014
    是這個(gè)問(wèn)題,所有我問(wèn)一下訪問(wèn)的url,哈哈。如果用services.xml進(jìn)行配置,名子是不會(huì)變的。
    2009-04-13 15:22 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    謝謝你們的指點(diǎn),博主辛苦了.
    2009-04-14 22:25 | ajax

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    @銀河使者
    怎么修改wsdl中的參數(shù),比如你在SimpleService中的name在wsdl中式param0,怎么把它改過(guò)來(lái)
    2009-04-28 18:04 | Spring

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    這個(gè)改不了,但使用services.xml文件來(lái)發(fā)布webservice,就是name了。試試看
    2009-04-28 19:43 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    gg.setName("比爾");
    這個(gè)地方,在我的環(huán)境里測(cè)試,是沒(méi)有setName方法的,
    我改成gg.setParam0("比爾");行了.
    2009-05-08 19:32 | 心夢(mèng)帆影

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    受益匪淺,希望博主及時(shí)更新,給大家提供更多的學(xué)習(xí)資源
    2009-05-13 23:02 | minmin

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    The import org.apache.axis2.rpc.client.RPCServiceClient cannot be resolved
    怎么解決?
    QQ 418329288
    2009-05-16 19:05 | bginner121

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    那個(gè)庫(kù)沒(méi)引用。你可以引用axis2中的所有的jar文件試試
    2009-05-16 19:31 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @銀河使者
    是的,我想知道具體要引用哪個(gè)包?
    2009-05-16 23:10 | bginner121

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @bginner121
    The import org.apache.axis2.rpc.client.RPCServiceClient cannot be resolved ,怎么解決?

    需要引用 axis2-adb-1.3.jar
    2009-05-16 23:15 | bginner121

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    如何解決?
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    The method setName(String) is undefined for the type SimpleServiceStub.GetGreeting

    at org.bgnnr.client.StubClient.main(StubClient.java:15)
    2009-05-17 00:57 | bginner121

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    你的程序有語(yǔ)法錯(cuò)誤,你是手工編譯的嗎?還是用eclipse?
    2009-05-17 09:20 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    你好,我照您的例子做了,不知什么原因?
    <ns:getGreetingResponse xmlns:ns="http://ws.apache.org/axis2">
    <return>hello null</return>
    </ns:getGreetingResponse>
    總是空直。。。郁悶啊!
    2009-05-17 18:23 | java web

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    http://localhost:8080/axis2/services/SimpleService/getGreeting?param0=bill
    試試
    2009-05-17 19:55 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    非常謝謝
    2009-05-19 18:39 | java web

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    如何解決?
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    The method setName(String) is undefined for the type SimpleServiceStub.GetGreeting

    at org.bgnnr.client.StubClient.main(StubClient.java:15)
    2009-05-21 12:41 | beginner121

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    setName方法未定義錯(cuò)誤。
    2009-05-21 13:15 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    太謝謝你了
    2009-08-13 15:17 | amado

    # 關(guān)于Faulty Services  回復(fù)  更多評(píng)論   

    您好,在按您的步驟進(jìn)行操作之后,我發(fā)布的服務(wù)卻無(wú)法顯示,是Faulty Services。點(diǎn)擊之后提示說(shuō)This Web axisService has deployment faults,錯(cuò)誤為Error: java.lang.UnsupportedClassVersionError: Bad version number in . 請(qǐng)問(wèn)您該怎么解決? 謝謝
    2009-08-14 19:59 | 亦澤

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    樓上你的問(wèn)題解決了嗎,我遇到了同樣的問(wèn)題
    2009-08-18 18:30 | tingyun

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    這個(gè)問(wèn)題是jdk的版本不對(duì),你們的機(jī)器上是否安裝了不同版本的jdk,需要使用同一個(gè)版本的jdk編譯程序才可以。
    2009-08-19 10:42 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    教程很不錯(cuò),講解很詳細(xì)
    2009-08-25 10:44 | 大鵬

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    問(wèn)個(gè)很菜的問(wèn)題.wsdl文件是怎么生成的???這里面沒(méi)有介紹.生成的stub文件夾應(yīng)該放在那個(gè)文件夾下面.項(xiàng)目中的SRC下???
    2009-09-08 21:32 | 小菜

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    wsdl文件是通過(guò)訪問(wèn)url自動(dòng)生成的。stub文件夾里的類放哪都行,只是普通的java類,不過(guò)別忘了改package
    2009-09-08 21:48 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    可以放在eclipse中的src目錄下就可以
    2009-09-08 21:48 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    想問(wèn)下,我的POJO編譯后的文件,放POJO目錄下,怎么AXIS2沒(méi)發(fā)現(xiàn)該服務(wù)的?我的也是AXIS2 1.4.1
    2009-09-13 09:20 | jackyrong

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    為什么我使用POJO發(fā)布一個(gè)不帶包名的類,但是AXIS2報(bào)錯(cuò):
    Error: org.apache.axis2.deployment.DeploymentException: Invalid service. META-INF directory not found. at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLs(ArchiveReader.java:297) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:67) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227) at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:324) at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:64) at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:71) at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:83) at java.util.TimerThread.mainLoop(Unknown Source) at java.util.TimerThread.run(Unknown Source) Caused by: org.apache.axis2.deployment.DeploymentException: Invalid service. META-INF directory not found. at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLs(ArchiveReader.java:285) ... 12 more
    2009-10-07 16:58 | smaxpp

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    沒(méi)有META-INF目錄,把pojo放哪個(gè)目錄里了?
    2009-10-07 18:09 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    放在C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis2\WEB-INF\services\pojo
    下了
    2009-10-07 20:20 | smaxpp

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    %AXIS2_HOME%\bin\wsdl2java -uri http://localhost:8080/axis2/services/SimpleService?wsdl -p client -s -o stub
    這句話執(zhí)行不了.報(bào)window 找不到%java_home%\bin

    2009-10-19 16:17 | 天空在線

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @smaxpp
    發(fā)布簡(jiǎn)單POJO目錄寫錯(cuò)了吧,應(yīng)該是在C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis2\WEB-INF下面新建一個(gè)pojo目錄,然后在將你要發(fā)布的pojo類文件放到里面。如果你要發(fā)布到services目錄下面,應(yīng)該是發(fā)布哪種達(dá)成aar包形式的Web Service。
    2009-10-31 17:38 | Mr.Blue

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @天空在線
    提示找不到%JAVA_HOME%\bin\java.exe這個(gè)的話你可以看看wsdl2java這個(gè)批處理的源碼,里面對(duì)報(bào)各種錯(cuò)誤都有比較詳細(xì)的說(shuō)明,你可以參照著一個(gè)個(gè)去解決各種異常。
    2009-10-31 17:44 | Mr.Blue

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    您好,請(qǐng)問(wèn)我按照您的方法將一個(gè)POJO發(fā)布成WebService,卻出現(xiàn)了下面的錯(cuò)誤,請(qǐng)問(wèn)這是為什么?
    This Web axisService has deployment faults
    Error: java.lang.NoClassDefFoundError: SimpleService (wrong name: po/SimpleService) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.codehaus.jam.internal.reflect.ReflectClassBuilder.build(ReflectClassBuilder.java:69) at org.codehaus.jam.provider.CompositeJamClassBuilder.build(CompositeJamClassBuilder.java:51) at org.codehaus.jam.internal.JamClassLoaderImpl.loadClass(JamClassLoaderImpl.java:128) at org.codehaus.jam.JamClassIterator.nextClass(JamClassIterator.java:68) at org.codehaus.jam.JamClassIterator.next(JamClassIterator.java:88) at org.apache.axis2.deployment.POJODeployer.deploy(POJODeployer.java:95) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227) at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:324) at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:64) at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:71) at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:83) at java.util.TimerThread.mainLoop(Unknown Source) at java.util.TimerThread.run(Unknown Source)
    2009-11-07 04:57 | 學(xué)習(xí)者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    SimpleService 沒(méi)找到
    2009-11-07 10:15 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    非常感謝!!
    2009-11-09 23:56 | 學(xué)習(xí)者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    非常感謝!!
    2009-11-19 10:34 | homezly

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    我也出現(xiàn) 類This Web axisService has deployment faults
    Error: java.lang.NoClassDefFoundError: SimpleService (wrong name: pojo/SimpleService) at

    的錯(cuò)誤,可我明明按要求放的,怎么就找不到呢
    用的JDK1.4.2 tomcat4 axis2 1.4.1


    出現(xiàn)以下
    Available services
    Version
    Service EPR : http://localhost:8080/axis2/services/Version

    Service Description : Version
    Service Status : Active
    Available Operations
    getVersion

    --------------------------------------------------------------------------------

    Faulty Services
    E:\jakarta-tomcat-4.1.31\webapps\axis2\WEB-INF\pojo\sayHello.class

    2009-11-22 23:01 | 學(xué)習(xí)者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @學(xué)習(xí)者
    出現(xiàn)找不到pojo/SimpleService的錯(cuò)誤,很明顯是你發(fā)布的pojo\sayHello.class服務(wù)名字與你想訪問(wèn)的名字不一致所致,可以修改E:\jakarta-tomcat-4.1.31\webapps\axis2\WEB-INF\pojo\SimpleService.class , 試試看
    2009-12-12 11:37 | Mr.Blue

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    樓主太牛了,謝謝啦
    2009-12-29 00:41 | 樓主太牛了

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    我一直沒(méi)弄明白,如果服務(wù)器端的方法需要一個(gè)復(fù)雜類型作為參數(shù),比如UserTO,但是客戶端沒(méi)有這個(gè)類型,那么怎么傳遞這個(gè)參數(shù)呢?請(qǐng)用java解答一下,不甚感激。
    2010-01-21 21:31 | 老章

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    樓主,首先謝謝你的這篇文章
    然后請(qǐng)教你一個(gè)問(wèn)題:
    我要是想給一個(gè)方法傳兩個(gè)參數(shù),那如何定義
    Object[] object = new Object[]{???};
    謝謝
    2010-03-25 14:21 | Lin

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    出現(xiàn)Faulty Services,什么原因呢?
    2010-04-02 08:21 | 小白

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @小白
    把調(diào)用代碼貼出來(lái)看看。可能是指的url不對(duì)
    2010-04-02 09:13 | 銀河使者

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    為什么我把SimpleService放入POJO目錄下找不到該服務(wù)?
    2010-04-12 11:38 | greedy

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    @ajax
    看wsdl文件,輸入?yún)?shù)是args0而不是你想要的name,所以得不到你想要的參數(shù)
    2010-05-15 20:13 | 楓葉

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @楓葉
    我這兒也是setName()問(wèn)題,改成setArgs0()就好了。
    2010-06-13 10:50 | Lu Wenhe

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    真的挺不錯(cuò)的,我喜歡哈佛的校訓(xùn)
    2010-08-19 17:47 | 夢(mèng)

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    太棒的教程了
    2010-08-30 11:55 | admin

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    您好,請(qǐng)問(wèn)web service是如何生成wsdl文件的呢?
    2010-09-14 11:45 | liyaling

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    訪問(wèn)URL:http://localhost:8080/axis2/services/SimpleService?wsdl
    后臺(tái)報(bào)了這個(gè)錯(cuò):[INFO] org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0xc8 (at char #1088, byte #-1)
    是編碼格式不對(duì),請(qǐng)問(wèn)這個(gè)怎么解決呢?
    2010-09-14 15:56 | liyaling

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @liyaling
    已經(jīng)知道了
    2010-09-16 11:45 | liyaling

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    This Web axisService has deployment faults
    Error: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.codehaus.jam.internal.reflect.ReflectClassBuilder.build(ReflectClassBuilder.java:69) at org.codehaus.jam.provider.CompositeJamClassBuilder.build(CompositeJamClassBuilder.java:51) at org.codehaus.jam.internal.JamClassLoaderImpl.loadClass(JamClassLoaderImpl.java:128) at org.codehaus.jam.JamClassIterator.nextClass(JamClassIterator.java:68) at org.codehaus.jam.JamClassIterator.next(JamClassIterator.java:88) at org.apache.axis2.deployment.POJODeployer.deploy(POJODeployer.java:95) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131) at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:82) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

    2011-01-10 14:15 | xiao

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    你好,拜讀了,感謝你的文章
    有一個(gè)問(wèn)題:
    我在服務(wù)端寫的方法返回類型是List或Map,然后自動(dòng)生成stub類,用stub類調(diào)用那個(gè)方法的時(shí)候?yàn)槭裁磿?huì)出錯(cuò)呢
    Exception in thread "main" org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unsupported type null anyType
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at com.ws.agan.service.ComplexServiceStub.fromOM(ComplexServiceStub.java:7119)
    at com.ws.agan.service.ComplexServiceStub.getUser4Map(ComplexServiceStub.java:507)
    at com.ws.agan.client.ComplexServiceClient.main(ComplexServiceClient.java:49)
    Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unsupported type null anyType
    at com.ws.agan.service.ComplexServiceStub$Map$Factory.parse(ComplexServiceStub.java:3615)
    at com.ws.agan.service.ComplexServiceStub$GetUser4MapResponse$Factory.parse(ComplexServiceStub.java:1972)
    at com.ws.agan.service.ComplexServiceStub.fromOM(ComplexServiceStub.java:7085)
    ... 2 more
    Caused by: org.apache.axis2.databinding.ADBException: Unsupported type null anyType
    at com.ws.agan.service.ComplexServiceStub$ExtensionMapper.getTypeObject(ComplexServiceStub.java:3149)
    at com.ws.agan.service.ComplexServiceStub$Map$Factory.parse(ComplexServiceStub.java:3564)
    ... 4 more

    其他返回簡(jiǎn)單數(shù)據(jù)類型的方法都沒(méi)有問(wèn)題,這是怎么回事呢博主?謝謝
    2011-05-27 14:53 | 阿甘

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    你好,可以將這個(gè)的視頻發(fā)給我嗎? 謝謝!
    2011-10-28 09:36 | superwingkoo

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    文中談到的搭建axis2 server& client 很好。指出一個(gè)bug:
    System.out.println(stub.getPrice().get_return()); ==>
    SimpleServiceStub.GetPrice gp = new SimpleServiceStub.GetPrice();
    System.out.println(stub.getPrice(gp).get_return());
    使用wsdl2java 生成的client 代碼,getPrice() 方法也是需要輸入?yún)?shù)的:
    public client.SimpleServiceStub.GetPriceResponse getPrice(

    client.SimpleServiceStub.GetPrice getPrice)
    # 未完待續(xù)!一個(gè)問(wèn)題請(qǐng)教


    2011-12-16 16:53 | 賈曉磊

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    按照教程上的描述, 在Java 中不論是自己寫client 還是使用wsdl2java 自動(dòng)生成clien可以比較自如地調(diào)用;
    由于業(yè)務(wù)需求,我自己搭建了一個(gè)python webservice. 在python中,server端和client 端可以正常調(diào)用,我用python client 調(diào)用java server, 剛開(kāi)始有字符集的問(wèn)題,后來(lái)調(diào)試之后也成功了。現(xiàn)在的問(wèn)題是使用axis2 client 不能成功訪問(wèn)python server;
    1: 按照文中提到的手寫client 的方法,自己寫了一個(gè)client,返回結(jié)果一直為空,axis2 client 的請(qǐng)求到不了 python server, 收到的結(jié)果為null。
    2: 我用wsdl2java 根據(jù)python發(fā)布的wsdl 自動(dòng)生成一個(gè)client 代碼,嚴(yán)格按照參數(shù)進(jìn)行調(diào)用,還是出問(wèn)題
    Exception in thread "main" org.apache.axis2.AxisFault: javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at client.SMSService2Stub.fromOM(SMSService2Stub.java:1598)
    at client.SMSService2Stub.getPrice(SMSService2Stub.java:177)
    at client.SMSService2Stub_Client.main(SMSService2Stub_Client.java:16)
    Caused by: java.lang.Exception: javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT
    at client.SMSService2Stub$Returns$Factory.parse(SMSService2Stub.java:1153)
    at client.SMSService2Stub.fromOM(SMSService2Stub.java:1592)
    ... 2 more
    Caused by: javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT
    at org.apache.axiom.om.impl.SwitchingWrapper.getElementText(SwitchingWrapper.java:981)
    at javax.xml.stream.util.StreamReaderDelegate.getElementText(StreamReaderDelegate.java:72)
    at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getElementText(XMLStreamReaderWrapper.java:100)
    at org.apache.axiom.util.stax.debug.XMLStreamReaderValidator.getElementText(XMLStreamReaderValidator.java:76)
    at client.SMSService2Stub$Returns$Factory.parse(SMSService2Stub.java:1124)
    ... 3 more

    # 我跟了一下源碼,還是搞不定。 博主有email嗎?可以詳細(xì)請(qǐng)教
    #qq: 281304051
    #gmail: jiaxiaolei19871112@gmail.com

    2011-12-16 17:27 | 賈曉磊

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    eclipse_jee版可以可視化的完成webservice發(fā)布以及stub的操作
    2012-02-21 21:55 | 游客

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    怎么不提供用axis請(qǐng)求.net 寫的webservice啊
    2012-03-27 14:09 | mars

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    我采用了axis2 1.6,1.5,1.4寫第一個(gè)簡(jiǎn)單webservice 帶參數(shù)的方法,給它傳值去獲取不到。類是直接ctrl+c的
    訪問(wèn)地址:http://localhost:8080/axis2/services/SimpleService/getGreeting?name=bill
    得到的結(jié)果是:
    <ns:getGreetingResponse xmlns:ns="http://ws.apache.org/axis2">
    <return>你好 null</return>
    </ns:getGreetingResponse>

    請(qǐng)問(wèn)這是什么原因,怎樣解決????
    qq:1004143305

    謝謝,比較急
    2012-08-26 11:17 | kunsy

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    @kunsy
    看了wsdl文件,里面的屬性名是param0,傳的是name所以根本獲取不到

    誰(shuí)有axis2 的環(huán)境配置,要求把a(bǔ)xis的所以的jar配置進(jìn)環(huán)境變量里。
    比如,我一個(gè)類,引用了axis jar里的某個(gè)類,我想通過(guò)cmd直接編譯。
    可是我怎么配置,都顯示類找不到。求幫助,謝了
    我就想通過(guò)cmd直接編譯,希望能給出具體的相關(guān)配置
    2012-08-26 12:57 | kunsy

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    怎么返回json數(shù)據(jù)啊、
    2012-10-11 16:23 | 憤怒的小鳥(niǎo)

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    學(xué)習(xí)了,感謝樓主分享,再接再厲期待更多佳作
    2012-10-15 17:34 | vvin

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    樓主 您好 我按照您的指導(dǎo)寫代碼 結(jié)果發(fā)現(xiàn)wdsl文件總是會(huì)出現(xiàn)兩個(gè)wsdl:binding 這是為什么呢?
    - <wsdl:binding name="SimpleServerSoap11Binding" type="ns:SimpleServerPortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="getPrice">
    <soap:operation soapAction="urn:getPrice" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="getGreeting">
    <soap:operation soapAction="urn:getGreeting" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:binding name="SimpleServerSoap12Binding" type="ns:SimpleServerPortType">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="getPrice">
    <soap12:operation soapAction="urn:getPrice" style="document" />
    - <wsdl:input>
    <soap12:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap12:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="getGreeting">
    <soap12:operation soapAction="urn:getGreeting" style="document" />
    - <wsdl:input>
    <soap12:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap12:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:binding name="SimpleServerHttpBinding" type="ns:SimpleServerPortType">
    <http:binding verb="POST" />
    - <wsdl:operation name="getPrice">
    <http:operation location="SimpleServer/getPrice" />
    - <wsdl:input>
    <mime:content type="text/xml" part="getPrice" />
    </wsdl:input>
    - <wsdl:output>
    <mime:content type="text/xml" part="getPrice" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="getGreeting">
    <http:operation location="SimpleServer/getGreeting" />
    - <wsdl:input>
    <mime:content type="text/xml" part="getGreeting" />
    </wsdl:input>
    - <wsdl:output>
    <mime:content type="text/xml" part="getGreeting" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="SimpleServer">
    - <wsdl:port name="SimpleServerHttpSoap11Endpoint" binding="ns:SimpleServerSoap11Binding">
    <soap:address location="http://localhost:8080/axis2/services/SimpleServer.SimpleServerHttpSoap11Endpoint/" />
    </wsdl:port>
    - <wsdl:port name="SimpleServerHttpSoap12Endpoint" binding="ns:SimpleServerSoap12Binding">
    <soap12:address location="http://localhost:8080/axis2/services/SimpleServer.SimpleServerHttpSoap12Endpoint/" />
    </wsdl:port>
    - <wsdl:port name="SimpleServerHttpEndpoint" binding="ns:SimpleServerHttpBinding">
    <http:address location="http://localhost:8080/axis2/services/SimpleServer.SimpleServerHttpEndpoint/" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    2012-11-05 15:16 | 云霄雨霽

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   


    您好,請(qǐng)問(wèn)我生成SimpleServiceStub.class文件的時(shí)候報(bào)錯(cuò):如下。可能是什么問(wèn)題造成的。先謝謝您
    C:\Users\Tumi>%AXIS2_HOME%\bin\wsdl2java -uri http://localhost:8080/axis2/servic
    es/SimpleService?wsdl -p client -s -o stub
    'D:\Development' 不是內(nèi)部或外部命令,也不是可運(yùn)行的程序
    或批處理文件。
    2013-03-01 17:30 | focus

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService[未登錄](méi)  回復(fù)  更多評(píng)論   

    哈哈,我也遇到這個(gè)問(wèn)題!感謝你!@賈曉磊
    2014-07-16 11:41 | 123

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    我也是一樣,wsdl里面的參數(shù)是args0,http://localhost:8080/axis2/services/SimpleService/getGreeting?args0=bill但是輸出還是null

    <ns:getGreetingResponse xmlns:ns="http://ws.apache.org/axis2">
    <return>鎮(zhèn)ㄥソ null</return>
    </ns:getGreetingResponse>
    我用的是tomcat8.x,axis1.6x
    而且還有中文亂碼,好急啊!希望樓主能解答啊
    2014-07-31 15:46 | tianqi

    # re: WebService大講堂之Axis2(1):用POJO實(shí)現(xiàn)0配置的WebService  回復(fù)  更多評(píng)論   

    在用命令行生成WebService,報(bào)了如下的錯(cuò)誤,請(qǐng)大神解答一下啊


    C:\Users\ibm\Desktop\boss>%AXIS2_HOME%\bin\wsdl2java -uri http://localhost:49401/OspWebService.asmx -p com.wenjun.webserivce -s -o stub
    Using AXIS2_HOME: C:\Develop\Tools\afterInstall\axis2-1.6.2
    Using JAVA_HOME: C:\Develop\Tools\Java\JDK1.6.0_14
    Retrieving document at 'http://localhost:49401/OspWebService.asmx'.
    [Fatal Error] OspWebService.asmx:108:17: The element type "p" must be terminated by the matching end-tag "</p>".
    log4j:WARN No appenders could be found for logger (org.apache.axis2.i18n.ProjectResourceBundle).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:178)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:49401/OspWebService.asmx'.: org.xml.sax.
    SAXParseException: The element type "p" must be terminated by the matching end-tag "</p>".
    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(CodeGenerationEngine.java:320)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:133)
    ... 2 more
    Caused by: org.xml.sax.SAXParseException: The element type "p" must be terminated by the matching end-tag "</p>".
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
    ... 7 more
    C:\Users\ibm\Desktop\boss>



    2015-05-31 12:15 | suwenjun
    評(píng)論共2頁(yè): 1 2 下一頁(yè) 
    主站蜘蛛池模板: 成人免费午夜视频| 精品国产亚洲AV麻豆| 无码精品A∨在线观看免费| 久久亚洲精品无码AV红樱桃| 国产一区二区免费视频| 亚洲成a人片在线观看日本| 国产成人精品免费久久久久| 久久综合日韩亚洲精品色| 久久国产精品萌白酱免费| 久久精品国产亚洲av成人| 国产精品视频白浆免费视频| 亚洲第一视频网站| 99在线观看免费视频| 亚洲天堂福利视频| 最近的免费中文字幕视频| 亚洲精品无码久久久久APP| 国产精品免费看香蕉| 特级aa**毛片免费观看| 久久精品亚洲男人的天堂| 日韩免费高清播放器| 色拍自拍亚洲综合图区| 性短视频在线观看免费不卡流畅| 亚洲国产乱码最新视频| 国产精品免费看久久久久| 四虎精品免费永久免费视频| 亚洲色精品88色婷婷七月丁香| 久久久久免费看黄a级试看| 亚洲国产视频网站| 好大好硬好爽免费视频| 极品美女一级毛片免费| 亚洲色成人中文字幕网站| 91青青青国产在观免费影视| 亚洲六月丁香婷婷综合| 国产成人啪精品视频免费网| 一个人免费观看日本www视频| 黑人精品videos亚洲人| 亚洲精品视频在线免费| 亚洲第一第二第三第四第五第六| 亚洲国产成人精品无码久久久久久综合| 不卡视频免费在线观看| 亚洲精品影院久久久久久|