如何修复wsdl文件错误?

时间:2022-10-16 10:00:53

Dears

I trying to make and create web service, firstly i created the server side and wsdl file, but i get some errors in this wsdl file and i tried many time to solve it, i guess i should check the xmlns or xsd.

我试图创建和创建Web服务,首先我创建了服务器端和wsdl文件,但我在这个wsdl文件中得到一些错误,我尝试了很多时间来解决它,我想我应该检查xmlns或xsd。

actually i'am new in webwervices and don't now exactly how to investigate them, please advise me and let me know the error in my code.

实际上我是webwevices的新手,现在不知道如何调查它们,请告诉我,让我知道我的代码中的错误。

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace"
xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:impl="http://DefaultNamespace" 
xmlns:intf="http://DefaultNamespace" 
xmlns:tns1="http://swing.javax" 
xmlns:tns2="http://awt.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 elementFormDefault="qualified"
targetNamespace="http://DefaultNamespace" 
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://awt.java"/>
<import namespace="http://swing.javax"/>

The errors is

错误是

  1. Description Resource Path Location Type src-resolve: Cannot resolve the name 'tns1:JPasswordField' to a(n) 'type definition' component. ImbCal.wsdl /SSPtest/WebContent/wsdl line 196 WSDL Problem

    说明资源路径位置类型src-resolve:无法将名称“tns1:JPasswordField”解析为(n)“类型定义”组件。 ImbCal.wsdl / SSPtest / WebContent / wsdl第196行WSDL问题

  2. Description Resource Path Location Type src-resolve: Cannot resolve the name 'tns2:List' to a(n) 'type definition' component. ImbCal.wsdl /SSPtest/WebContent/wsdl line 171 WSDL Problem

    说明资源路径位置类型src-resolve:无法将名称“tns2:List”解析为(n)“类型定义”组件。 ImbCal.wsdl / SSPtest / WebContent / wsdl第171行WSDL问题

  3. Description Resource Path Location Type schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . ImbCal.wsdl /SSPtest/WebContent/wsdl line 7 WSDL Problem

    说明资源路径位置类型schema_reference.4:无法读取架构文档“null”,因为1)找不到该文档; 2)文件无法阅读; 3)文档的根元素不是。 ImbCal.wsdl / SSPtest / WebContent / wsdl第7行WSDL问题

  4. Description Resource Path Location Type schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . ImbCal.wsdl /SSPtest/WebContent/wsdl line 8 WSDL Problem

    说明资源路径位置类型schema_reference.4:无法读取架构文档“null”,因为1)找不到该文档; 2)文件无法阅读; 3)文档的根元素不是。 ImbCal.wsdl / SSPtest / WebContent / wsdl第8行WSDL问题

here one of elements

这里有一个要素

<element name="dbSelect">
    <complexType>
     <sequence>
      <element name="sql" type="xsd:string"/>
      <element name="level" type="xsd:string"/>
      <element name="mat_sel2" type="tns2:List"/>
      <element name="mymaterial" type="tns2:List"/>
     </sequence>
    </complexType>
   </element>

1 个解决方案

#1


0  

This is the full code, i just edit the wrong from the code and regenerate the wsdll.

这是完整的代码,我只是从代码编辑错误并重新生成wsdll。

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace"
xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:impl="http://DefaultNamespace" 
xmlns:intf="http://DefaultNamespace" 
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 elementFormDefault="qualified" 
targetNamespace="http://DefaultNamespace" xmlns="http://www.w3.org
/2001/XMLSchema">
<element name="main">
<complexType>
 <sequence>
  <element maxOccurs="unbounded" name="arg" type="xsd:string"/>
 </sequence>
</complexType>
</element>
<element name="mainResponse">
<complexType>
 <sequence>
  <element maxOccurs="unbounded" name="mainReturn" type="xsd:string"/>
  </sequence>
 </complexType>
 </element>
 <element name="finalmaterial">
 <complexType>
 <sequence>
  <element name="Couresn" type="xsd:string"/>
  <element name="IDL" type="xsd:string"/>
  <element name="Myco2" type="xsd:string"/>
  <element name="userlevel" type="xsd:int"/>
  <element name="LevelL" type="xsd:string"/>
  </sequence>
  </complexType>
  </element>
  <element name="finalmaterialResponse">
  <complexType>
  <sequence>
  <element maxOccurs="unbounded" name="finalmaterialReturn" 
  type="xsd:string"/>
  </sequence>
  </complexType>
  </element>
  </schema>
  </wsdl:types>
  <wsdl:message name="finalmaterialRequest">
  <wsdl:part element="impl:finalmaterial" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:message name="finalmaterialResponse">
  <wsdl:part element="impl:finalmaterialResponse" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:message name="mainRequest">
  <wsdl:part element="impl:main" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:message name="mainResponse">
  <wsdl:part element="impl:mainResponse" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ImbCal">
  <wsdl:operation name="main">
     <wsdl:input message="impl:mainRequest" name="mainRequest">
   </wsdl:input>
     <wsdl:output message="impl:mainResponse" name="mainResponse">
   </wsdl:output>
  </wsdl:operation>
  <wsdl:operation name="finalmaterial">
     <wsdl:input message="impl:finalmaterialRequest" 
   name="finalmaterialRequest">
   </wsdl:input>
     <wsdl:output message="impl:finalmaterialResponse" 
   name="finalmaterialResponse">
   </wsdl:output>
   </wsdl:operation>
   </wsdl:portType>
    <wsdl:binding name="ImbCalSoapBinding" type="impl:ImbCal">
   <wsdlsoap:binding style="document" 
   transport="http://schemas.xmlsoap.org/soap/http"/>
   <wsdl:operation name="main">
     <wsdlsoap:operation soapAction=""/>
     <wsdl:input name="mainRequest">
        <wsdlsoap:body use="literal"/>
     </wsdl:input>
     <wsdl:output name="mainResponse">
        <wsdlsoap:body use="literal"/>
     </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="finalmaterial">
     <wsdlsoap:operation soapAction=""/>
     <wsdl:input name="finalmaterialRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="finalmaterialResponse">
        <wsdlsoap:body use="literal"/>
     </wsdl:output>
     </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="ImbCalService">
      <wsdl:port binding="impl:ImbCalSoapBinding" name="ImbCal">
      <wsdlsoap:address location="http://localhost:8080/SSPwebservice
      /services/ImbCal"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions> 

#1


0  

This is the full code, i just edit the wrong from the code and regenerate the wsdll.

这是完整的代码,我只是从代码编辑错误并重新生成wsdll。

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace"
xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:impl="http://DefaultNamespace" 
xmlns:intf="http://DefaultNamespace" 
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 elementFormDefault="qualified" 
targetNamespace="http://DefaultNamespace" xmlns="http://www.w3.org
/2001/XMLSchema">
<element name="main">
<complexType>
 <sequence>
  <element maxOccurs="unbounded" name="arg" type="xsd:string"/>
 </sequence>
</complexType>
</element>
<element name="mainResponse">
<complexType>
 <sequence>
  <element maxOccurs="unbounded" name="mainReturn" type="xsd:string"/>
  </sequence>
 </complexType>
 </element>
 <element name="finalmaterial">
 <complexType>
 <sequence>
  <element name="Couresn" type="xsd:string"/>
  <element name="IDL" type="xsd:string"/>
  <element name="Myco2" type="xsd:string"/>
  <element name="userlevel" type="xsd:int"/>
  <element name="LevelL" type="xsd:string"/>
  </sequence>
  </complexType>
  </element>
  <element name="finalmaterialResponse">
  <complexType>
  <sequence>
  <element maxOccurs="unbounded" name="finalmaterialReturn" 
  type="xsd:string"/>
  </sequence>
  </complexType>
  </element>
  </schema>
  </wsdl:types>
  <wsdl:message name="finalmaterialRequest">
  <wsdl:part element="impl:finalmaterial" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:message name="finalmaterialResponse">
  <wsdl:part element="impl:finalmaterialResponse" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:message name="mainRequest">
  <wsdl:part element="impl:main" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:message name="mainResponse">
  <wsdl:part element="impl:mainResponse" name="parameters">
  </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ImbCal">
  <wsdl:operation name="main">
     <wsdl:input message="impl:mainRequest" name="mainRequest">
   </wsdl:input>
     <wsdl:output message="impl:mainResponse" name="mainResponse">
   </wsdl:output>
  </wsdl:operation>
  <wsdl:operation name="finalmaterial">
     <wsdl:input message="impl:finalmaterialRequest" 
   name="finalmaterialRequest">
   </wsdl:input>
     <wsdl:output message="impl:finalmaterialResponse" 
   name="finalmaterialResponse">
   </wsdl:output>
   </wsdl:operation>
   </wsdl:portType>
    <wsdl:binding name="ImbCalSoapBinding" type="impl:ImbCal">
   <wsdlsoap:binding style="document" 
   transport="http://schemas.xmlsoap.org/soap/http"/>
   <wsdl:operation name="main">
     <wsdlsoap:operation soapAction=""/>
     <wsdl:input name="mainRequest">
        <wsdlsoap:body use="literal"/>
     </wsdl:input>
     <wsdl:output name="mainResponse">
        <wsdlsoap:body use="literal"/>
     </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="finalmaterial">
     <wsdlsoap:operation soapAction=""/>
     <wsdl:input name="finalmaterialRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="finalmaterialResponse">
        <wsdlsoap:body use="literal"/>
     </wsdl:output>
     </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="ImbCalService">
      <wsdl:port binding="impl:ImbCalSoapBinding" name="ImbCal">
      <wsdlsoap:address location="http://localhost:8080/SSPwebservice
      /services/ImbCal"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>