2013-03-28 69 views
2

我要創建一個客戶端對於給定的WSDL創建Java代碼...錯誤的Axis2從WSDL

<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:base="http://www.impresainungiorno.gov.it/schema/base" xmlns:bus="http://www.cnipa.it/schemas/2003/eGovIT/Busta1_0/" xmlns:eb="http://www.metaware.it/geofront2/estensioni_busta.xsd" xmlns:ns0="http://www.impresainungiorno.gov.it/schema/suap/ri/spc/ws" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:spc="http://www.impresainungiorno.gov.it/schema/suap/ri/spc" targetNamespace="http://www.impresainungiorno.gov.it/schema/suap/ri/spc/ws"> 
    <wsdl:types> 
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:pi="http://www.impresainungiorno.gov.it/schema/base" xmlns:ri="http://www.impresainungiorno.gov.it/schema/suap/ri/spc" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.impresainungiorno.gov.it/schema/suap/ri/spc" version="1.0.0" xmlns:spc="http://www.impresainungiorno.gov.it/schema/suap/ri/spc"> 
    <!-- 
    --> 
    <xs:import namespace="http://www.impresainungiorno.gov.it/schema/base"/> 

........ 

    <xsd:element name="Intestazione"> 
     <xsd:complexType> 
      <xsd:sequence> 
       <xsd:element ref="IntestazioneMessaggio"/> 
       <xsd:element minOccurs="0" ref="ListaRiscontri"/> 
       <xsd:element minOccurs="0" ref="ListaTrasmissioni"/> 
       <xsd:element minOccurs="0" ref="ListaEccezioni"/> 
      </xsd:sequence> 
      <xsd:attribute fixed="http://www.cnipa.it/eGov_it/portadominio" ref="SOAP_ENV:actor" use="required"/> 
      <xsd:attribute fixed="1" ref="SOAP_ENV:mustUnderstand" use="required"/> 
     </xsd:complexType> 
    </xsd:element> 

........ 

我使用的Axis2從駕駛室管理線1.6.2 WSDL2Java工具,但我遇到了以下錯誤:

Retrieving document at 'richiesta-iscrizione-impresa-RI.wsdl'. 
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:293) 
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) 
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) 
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:126) 
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:246) 
    ... 2 more 
Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:115) 
    ... 3 more 
Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: error: src-resolve: attribute '[email protected]://schemas.xmlsoap.org/soap/envelope/' not found. 
    at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325) 
    ... 8 more 
Caused by: org.apache.xmlbeans.XmlException: error: src-resolve: attribute '[email protected]://schemas.xmlsoap.org/soap/envelope/' not found. 
    at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) 
    at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:189) 
    ... 8 more 

我檢查的模式和「演員」屬性存在....

什麼問題?

由於

安德烈

+0

SOAP_ENV指向哪個名稱空間? – beny23

+0

它指向'xmlns:soap =「http:// schemas.xmlsoap.org/wsdl/soap /'... wsdl指的是政府服務 – andrea

回答

1

有不同的編碼types of WSDLs像RPC /編碼,RPC /文字,文檔/編碼,文檔/文字。我認爲你的WSDL正在使用RPC /編碼。 Axis2不直接支持RPC /編碼的編碼風格。

這篇文章是關於使用RPC/encoded WSDLs with Axis2。我希望這將有所幫助。

0

軸2不支持rpc /編碼風格的webservices。您將不得不使用軸1