我用eclipse8.0,new  web service client -根据已有的wsdl自动获得客户端代码时老是报错!
如下:(弹出error窗口)
IWAB0399E Error in generating Java from WSDL:  java.io.IOException: Type {http://sql.java}SQLException is referenced but not defined控制台: 
- The class java.sql.SQLException is defined in a java or javax package and cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.
- The class java.sql.SQLException is defined in a java or javax package and cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.
- The class java.sql.SQLException is defined in a java or javax package and cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.
- The class java.sql.SQLException is defined in a java or javax package and cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.
- The class java.sql.SQLException is defined in a java or javax package and cannot be converted into an xml schema type.  An xml schema anyType will be used to define this class in the wsdl file.高手帮忙看看——急急……

解决方案 »

  1.   

    用jdk的工具 wsimport -s src -p package wsdl
    一键搞定
      

  2.   


    IWAB0399E Error in generating Java from WSDL: java.io.IOException: Type {http://sql.java}SQLException is referenced but not defined这个已经说的很清楚了呀,LZ自己查下
      

  3.   

      
    以下是wsdl文件内容,(请问一下:我是想把一个项目中的一个发个短信的功能,写一个web service
    我用的是axis,那我的webservice是不是发布带有发短信功能的那个类就行了,其他的类不用管,生成客户端时要不要导入相关的包啊,我是个新手,大家多多帮忙啊,谢谢!<?xml version="1.0" encoding="UTF-8" ?> 
    - <wsdl:definitions targetNamespace="http://localhost:8080/JS/services/webservice1" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/JS/services/webservice1" xmlns:intf="http://localhost:8080/JS/services/webservice1" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://dbcomm.base.tool.com" xmlns:tns2="http://sql.java" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <!-- 
    WSDL created by Apache Axis version: 1.4
    Built on Apr 22, 2006 (06:55:48 PDT)  --> 
    - <wsdl:types>
    - <schema targetNamespace="http://localhost:8080/JS/services/webservice1" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://sql.java" /> 
      <import namespace="http://dbcomm.base.tool.com" /> 
      <import namespace="http://xml.apache.org/xml-soap" /> 
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
    - <complexType name="ArrayOf_xsd_anyType">
    - <complexContent>
    - <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]" /> 
      </restriction>
      </complexContent>
      </complexType>
      </schema>
    - <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://sql.java" /> 
      <import namespace="http://dbcomm.base.tool.com" /> 
      <import namespace="http://localhost:8080/JS/services/webservice1" /> 
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
    - <complexType name="Vector">
    + <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:anyType" /> 
      </sequence>
      </complexType>
      </schema>
    - <schema targetNamespace="http://dbcomm.base.tool.com" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://sql.java" /> 
      <import namespace="http://xml.apache.org/xml-soap" /> 
      <import namespace="http://localhost:8080/JS/services/webservice1" /> 
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
    - <complexType name="DBException">
    - <sequence>
      <element name="SQLException" nillable="true" type="xsd:anyType" /> 
      <element name="SQLMessage" nillable="true" type="soapenc:string" /> 
      <element name="SQLState" nillable="true" type="soapenc:string" /> 
      <element name="errorCode" type="xsd:int" /> 
      <element name="message" nillable="true" type="soapenc:string" /> 
      <element name="nextException" nillable="true" type="tns2:SQLException" /> 
      </sequence>
      </complexType>
      </schema>
      </wsdl:types>
    - <wsdl:message name="DBException">
      <wsdl:part name="fault" type="tns1:DBException" /> 
      </wsdl:message>
      <wsdl:message name="sendMessageResponse" /> 
    - <wsdl:message name="SendBooleanRequest">
      <wsdl:part name="mobile" type="soapenc:string" /> 
      <wsdl:part name="content" type="soapenc:string" /> 
      </wsdl:message>
    - <wsdl:message name="sendMessageRequest">
      <wsdl:part name="sendInfo" type="impl:ArrayOf_xsd_anyType" /> 
      </wsdl:message>
    - <wsdl:message name="SendBooleanResponse">
      <wsdl:part name="SendBooleanReturn" type="xsd:boolean" /> 
      </wsdl:message>
    - <wsdl:portType name="SendMessageByCat">
    - <wsdl:operation name="sendMessage" parameterOrder="sendInfo">
      <wsdl:input message="impl:sendMessageRequest" name="sendMessageRequest" /> 
      <wsdl:output message="impl:sendMessageResponse" name="sendMessageResponse" /> 
      <wsdl:fault message="impl:DBException" name="DBException" /> 
      </wsdl:operation>
    - <wsdl:operation name="SendBoolean" parameterOrder="mobile content">
      <wsdl:input message="impl:SendBooleanRequest" name="SendBooleanRequest" /> 
      <wsdl:output message="impl:SendBooleanResponse" name="SendBooleanResponse" /> 
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="webservice1SoapBinding" type="impl:SendMessageByCat">
      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
    - <wsdl:operation name="sendMessage">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="sendMessageRequest">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://cat.sms.zk.com" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="sendMessageResponse">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/JS/services/webservice1" use="encoded" /> 
      </wsdl:output>
    - <wsdl:fault name="DBException">
      <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="DBException" namespace="http://localhost:8080/JS/services/webservice1" use="encoded" /> 
      </wsdl:fault>
      </wsdl:operation>
    - <wsdl:operation name="SendBoolean">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="SendBooleanRequest">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://cat.sms.zk.com" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="SendBooleanResponse">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/JS/services/webservice1" use="encoded" /> 
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="SendMessageByCatService">
    - <wsdl:port binding="impl:webservice1SoapBinding" name="webservice1">
      <wsdlsoap:address location="http://localhost:8080/JS/services/webservice1" /> 
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>