tkivdrip 2010-05-20 13:24
浏览 609
已采纳

WSDL命名空间报错

今天做个项目 需要将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>
  • 写回答

1条回答 默认 最新

  • xiaohuxiaoyu 2010-05-20 15:21
    关注

    你是需要用webservice提供得wsdl地址生成客户端代码是吧?如果是得话我这里有个生成器可以给你,加我QQ170349924

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学中在线排序的时间在线排序的在线LPT算法
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧