我有两个WSDL文件.
我正在尝试在complexType元素中的另一个WSDL文件中使用一个WSDL类型中定义的元素.
我正在尝试在complexType元素中的另一个WSDL文件中使用一个WSDL类型中定义的元素.
为此,我使用import元素包含了另一个WSDL文件(otherfile.wsdl在同一个文件夹中).
此外,我设置名称空间并使用ref属性(加上名称空间)来引用其他WSDL文件中的元素.
但是,它抱怨来自其他命名空间的元素无法从此test.wsdl xml架构中引用.
有人知道如何解决这个问题吗?
test.wsdl
<deFinitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.com/test/" xmlns:ot="http://www.example.com/othertest/" targetNamespace="http://www.example.com/test/" > <import namespace="http://www.example.com/othertest/" location="othertest.wsdl"/> <types> <xsd:schema targetNamespace="http://www.example.com/test/"> <xsd:element name="ResultElement2"> <xsd:complexType> <xsd:sequence> <xsd:element ref="ot:othertest_element" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </types> </deFinitions>
othertest.wsdl
<deFinitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.com/othertest/" targetNamespace="http://www.example.com/othertest/" > <types> <xsd:schema targetNamespace="http://www.example.com/othertest/"> <xsd:element name="othertest_element"> <xsd:simpleType> <xsd:restriction base="xsd:int"/> </xsd:simpleType> </xsd:element> </xsd:schema> </types> </deFinitions>
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。