亲爱的
我尝试制作和创建Web服务,首先我创建了服务器端和wsdl文件,但是我在这个wsdl文件中遇到了一些错误,我尝试了很多次来解决它,我想我应该检查xmlns或xsd。
实际上我是 webwervices 的新手,现在不知道如何调查它们,请告诉我并让我知道代码中的错误。
<?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"/>
错误是
描述资源路径位置类型 src-resolve:无法将名称“tns1:JPasswordField”解析为(n)“类型定义”组件。 ImbCal.wsdl/SSPtest/WebContent/wsdl 第 196 行 WSDL 问题
描述资源路径位置类型 src-resolve:无法将名称“tns2:List”解析为(n)“类型定义”组件。 ImbCal.wsdl/SSPtest/WebContent/wsdl 第 171 行 WSDL 问题
描述资源路径位置类型 schema_reference.4:无法读取架构文档“null”,因为 1) 找不到该文档; 2)文档无法读取; 3) 文档的根元素不是 。 ImbCal.wsdl/SSPtest/WebContent/wsdl 第 7 行 WSDL 问题
描述资源路径位置类型 schema_reference.4:无法读取架构文档“null”,因为 1) 找不到该文档; 2)文档无法读取; 3) 文档的根元素不是 。 ImbCal.wsdl/SSPtest/WebContent/wsdl 第 8 行 WSDL 问题
这里是元素之一
<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>
最佳答案
这是完整的代码,我只是编辑代码中的错误并重新生成 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>
关于java - 如何修复 wsdl 文件错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35323524/