今天做个项目 需要将WSDL 生成客户端JAVA代码 和 逆向生成 JAVA服务端代码 但是拷贝到eclipse中就报错
例如
src-resolve.4.2: Error resolving component 'ns1:authReq'. It was detected that 'ns1:authReq' is in namespace 'http://www.chinamobile.com/vgop/auth/v1_0/common', but components from this namespace are not referenceable from schema document 'file:///D:/WebService/TestYMChinaMobileXFire/wsdl/UserAuth.wsdl'. If this is the incorrect namespace, perhaps the prefix of 'ns1:authReq' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///D:/WebService/TestYMChinaMobileXFire/wsdl/UserAuth.wsdl'.
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://www.chinamobile.com/vgop/auth/v1_0" xmlns:tns="http://www.chinamobile.com/vgop/auth/v1_0" xmlns:ns1="http://www.chinamobile.com/vgop/auth/v1_0/common" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.chinamobile.com/vgop/auth/v1_0/common"> <xsd:complexType name="AddressInfo"> <xsd:sequence> <xsd:element minOccurs="1" name="platType" type="xsd:string"></xsd:element> <xsd:element minOccurs="1" name="provType" type="xsd:string"></xsd:element> </xsd:sequence> </xsd:complexType> <xsd:element nillable="false" name="sendAddress" type="ns1:AddressInfo"/> <xsd:element nillable="false" name="destAddress" type="ns1:AddressInfo"/> <xsd:element nillable="false" name="originalAddress" type="ns1:AddressInfo"/> <xsd:element nillable="false" name="msgName" type="xsd:string"/> <xsd:element nillable="false" name="transactionID" type="xsd:string"/> <xsd:element nillable="false" name="timeStamp" type="xsd:string"/> <xsd:element nillable="false" name="version" type="xsd:string"/> <xsd:complexType name="ServParamInfo"> <xsd:sequence> <xsd:element minOccurs="1" name="para_num" type="xsd:int"/> <xsd:element maxOccurs="unbounded" minOccurs="0" name="para_info" type="ns1:ParamInfo"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ParamInfo"> <xsd:sequence> <xsd:element minOccurs="1" name="para_name" type="xsd:string"/> <xsd:element minOccurs="1" name="para_value" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="authReq"> <xsd:sequence> <xsd:element minOccurs="1" name="oprCode" type="xsd:string"/> <xsd:element minOccurs="1" name="userID" type="xsd:string"/> <xsd:element minOccurs="0" name="CCPasswd" type="xsd:string"/> <xsd:element minOccurs="0" name="servType" type="xsd:string"/> <xsd:element minOccurs="0" name="subServType" type="xsd:string"/> <xsd:element minOccurs="0" name="servParamInfo" type="ns1:ServParamInfo"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="authResp"> <xsd:sequence> <xsd:element minOccurs="1" name="result" type="xsd:int"/> <xsd:element minOccurs="0" name="userStatus" type="xsd:string"/> <xsd:element minOccurs="0" name="statusChgTime" type="xsd:string"/> <xsd:element minOccurs="0" name="otherStatus" type="xsd:string" /> <xsd:element minOccurs="0" name="homeProv" type="xsd:string"/> <xsd:element minOccurs="0" name="brand" type="xsd:string" /> <xsd:element minOccurs="0" name="servParamInfo" type="ns1:ServParamInfo"/> </xsd:sequence> </xsd:complexType> </xsd:schema> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.chinamobile.com/vgop/auth/v1_0"> <xsd:element name="auth"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="1" name="authReq" type="ns1:authReq"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="authResponse"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="1" name="authResp" type="ns1:authResp"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="authRequest"> <wsdl:part name="parameters" element="tns:auth"> </wsdl:part> <wsdl:part name="msgName" element="ns1:msgName"/> <wsdl:part name="transactionID" element="ns1:transactionID"/> <wsdl:part name="version" element="ns1:version"/> <wsdl:part name="sendAddress" element="ns1:sendAddress"/> <wsdl:part name="destAddress" element="ns1:destAddress"/> <wsdl:part name="originalAddress" element="ns1:originalAddress"/> <wsdl:part name="timeStamp" element="ns1:timeStamp"/> </wsdl:message> <wsdl:message name="authResponse"> <wsdl:part name="parameters" element="tns:authResponse"> </wsdl:part> </wsdl:message> <wsdl:portType name="AuthServicePortType"> <wsdl:operation name="auth"> <wsdl:input name="authRequest" message="tns:authRequest"> </wsdl:input> <wsdl:output name="authResponse" message="tns:authResponse"> </wsdl:output> </wsdl:operation> </wsdl:portType> <wsdl:binding name="AuthServiceHttpBinding" type="tns:AuthServicePortType"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="auth"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="authRequest"> <wsdlsoap:body use="literal" parts="parameters" /> <wsdlsoap:header use="literal" message="tns:authRequest" part="msgName"/> <wsdlsoap:header use="literal" message="tns:authRequest" part="transactionID"/> <wsdlsoap:header use="literal" message="tns:authRequest" part="version"/> <wsdlsoap:header use="literal" message="tns:authRequest" part="sendAddress"/> <wsdlsoap:header use="literal" message="tns:authRequest" part="destAddress"/> <wsdlsoap:header use="literal" message="tns:authRequest" part="originalAddress"/> <wsdlsoap:header use="literal" message="tns:authRequest" part="timeStamp"/> </wsdl:input> <wsdl:output name="authResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="AuthService"> <wsdl:port name="AuthServiceHttpPort" binding="tns:AuthServiceHttpBinding"> <wsdlsoap:address location="http://localhost:8080/VGOP/service/AuthService"/> </wsdl:port> </wsdl:service> </wsdl:definitions>