用wsimport调用wsdl文件出现以下错误:warning: src-resolve: Cannot resolve the name 'soapenc:Array' to a(n) 'type defi
nition' component.
  line 0 of file:/E:/EMC4DG/%E8%A1%8C%E6%94%BF__webservice/GetHeTongByRYReport.x
ml#types?schema1
error: undefined simple or complex type 'soapenc:Array'
  line 0 of file:/E:/EMC4DG/%E8%A1%8C%E6%94%BF__webservice/GetHeTongByRYReport.x
ml#types?schema1
error: undefined attribute 'soapenc:arrayType'
  line 0 of file:/E:/EMC4DG/%E8%A1%8C%E6%94%BF__webservice/GetHeTongByRYReport.x
ml#types?schema1
error: org.xml.sax.SAXParseException: undefined attribute 'soapenc:arrayType'服务方只提供了一个wsdl文件。
原wsdl文件内容如下:
<wsdl:definitions targetNamespace="urn:DefaultNamespace" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:DefaultNamespace" xmlns:intf="urn:DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <wsdl:types>
      <schema targetNamespace="urn:DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
         <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
         <complexType name="RETURNDATAINFO">
            <sequence>
               <element name="DW" type="xsd:string"/>
               <element name="MC" type="xsd:string"/>
               <element name="BLRC" type="xsd:string"/>
               <element name="CSRC" type="xsd:string"/>
               <element name="BMGRJSBJL" type="xsd:string"/>
            </sequence>
         </complexType>
         <complexType name="ArrayOfRETURNDATAINFO">
            <complexContent>
               <restriction base="soapenc:Array">
                  <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:RETURNDATAINFO[]" xmlns:wsdl1="http://schemas.xmlsoap.org/wsdl/"/>
               </restriction>
            </complexContent>
         </complexType>
         <complexType name="RETURNDATA">
            <sequence>
               <element name="TITLE" type="xsd:string"/>
               <element name="PRINTDATE" type="xsd:string"/>
               <element name="SJROWS" nillable="true" type="impl:ArrayOfRETURNDATAINFO"/>
               <element name="QXJROWS" nillable="true" type="impl:ArrayOfRETURNDATAINFO"/>
            </sequence>
         </complexType>
      </schema>
   </wsdl:types>
   <wsdl:message name="GET_RYHTJSLRequest">
      <wsdl:part name="MONTHX" type="xsd:string"/>
   </wsdl:message>
   <wsdl:message name="GET_RYHTJSLResponse">
      <wsdl:part name="GET_RYHTJSLReturn" type="impl:RETURNDATA"/>
   </wsdl:message>
   <wsdl:portType name="GetHeTongByRYReport">
      <wsdl:operation name="GET_RYHTJSL" parameterOrder="MONTHX">
         <wsdl:input message="impl:GET_RYHTJSLRequest" name="GET_RYHTJSLRequest"/>
         <wsdl:output message="impl:GET_RYHTJSLResponse" name="GET_RYHTJSLResponse"/>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="GetHeTongByRYReport_HttpSoapBinding" type="impl:GetHeTongByRYReport">
      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="GET_RYHTJSL">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="GET_RYHTJSLRequest">
            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:DefaultNamespace" use="encoded"/>
         </wsdl:input>
         <wsdl:output name="GET_RYHTJSLResponse">
            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:DefaultNamespace" use="encoded"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="GetHeTongByRYReportService">
      <wsdl:port binding="impl:GetHeTongByRYReport_HttpSoapBinding" name="GetHeTongByRYReport_Http">
         <wsdlsoap:address location="http://192.168.0.19:80/oak/afxjdw.nsf/GetHeTongByRYReport?OpenWebService"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

解决方案 »

  1.   

    这个.很伤脑筋..
    就一个wsdl不方便分析...= =
    帮你顶上..等待高人..
      

  2.   

    问题在
     <complexType name="ArrayOfRETURNDATAINFO">
                <complexContent>
                   <restriction base="soapenc:Array">
                      <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:RETURNDATAINFO[]" xmlns:wsdl1="http://schemas.xmlsoap.org/wsdl/"/>
                   </restriction>
                </complexContent>
             </complexType>是不是这种数组形式有问题