通过使用axis2的
%AXIS2_HOME%\bin\wsdl2java -uri http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p client -s -o stub
命令不可以自动生成客户端代码,求高手解决!!!!!!!
结果报错
Retrieving document at 'http://219.142.71.142/CigaTransService/CigaData.asmx?WSD
L-p'.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:156)
        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=OTHER_ERROR: Unabl
e to resolve imported document at 'http://219.142.71.142/CigaTransService/CigaDa
ta.asmx?WSDL-p'.: java.io.IOException: Server returned HTTP response code: 403 f
or URL: http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p
        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:288)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:111)
        ... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL:
 http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:800)
        at java.net.URL.openStream(URL.java:913)
        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)        ... 6 more
D:\innerReal2\T_GetWebService>%AXIS2_HOME%\bin\wsdl2java -uri http://219.142.71.
142/CigaTransService/CigaData.asmx?WSDL-p client -s -o stub
Using AXIS2_HOME:   E:\devoloper\WebService\axis2-1.4.1
Using JAVA_HOME:    E:\devoloper\j2sdk1.4.2_09
Retrieving document at 'http://219.142.71.142/CigaTransService/CigaData.asmx?WSD
L-p'.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:156)
        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=OTHER_ERROR: Unabl
e to resolve imported document at 'http://219.142.71.142/CigaTransService/CigaDa
ta.asmx?WSDL-p'.: java.io.IOException: Server returned HTTP response code: 403 f
or URL: http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p
        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:288)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:111)
        ... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL:
 http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:800)
        at java.net.URL.openStream(URL.java:913)
        at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)        ... 6 more

解决方案 »

  1.   

    跪求高手解决啊???我用的是axis2-1.4.1调用C#的asmx的web service 地址是:http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL
    在dos下输入命令行:
    %AXIS2_HOME%\bin\wsdl2java -uri http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p client -s -o stub结果报错:
    Retrieving document at 'http://219.142.71.142/CigaTransService/CigaData.asmx?WSD
    L-p'.
    Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
    : Error parsing WSDL
            at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:156)
            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=OTHER_ERROR: Unabl
    e to resolve imported document at 'http://219.142.71.142/CigaTransService/CigaDa
    ta.asmx?WSDL-p'.: java.io.IOException: Server returned HTTP response code: 403 f
    or URL: http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p
            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:288)
            at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:111)
            ... 2 more
    Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL:
     http://219.142.71.142/CigaTransService/CigaData.asmx?WSDL-p
            at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:800)
            at java.net.URL.openStream(URL.java:913)
            at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)        ... 6 more