Spring SOAP 合并 .xsd 个文件
Spring SOAP merging .xsd files
我的网络服务中有两个 .xsd 文件,我会把它们写在这里,我的目标是拥有一个 xsd 文件而不是两个,并且仍然具有相同的功能(这样我就只能有一个 wsdl),我试图在这里和 goolge 中搜索类似的问题,但找不到任何问题,也许我写错了问题:/
文件 1 和 2:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.org.com/action"
targetNamespace="http://www.org.com/action" elementFormDefault="qualified">
<xs:element name="getActionRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getActionResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.org.com/validate"
targetNamespace="http://www.org.com/validate" elementFormDefault="qualified">
<xs:element name="getValidateRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
<xs:element name="Value" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getValidateResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
应该可行:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.org.com/action"
targetNamespace="http://www.org.com/action"
elementFormDefault="qualified">
<xs:element name="getActionRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getActionResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getValidateRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
<xs:element name="Value" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getValidateResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
我的网络服务中有两个 .xsd 文件,我会把它们写在这里,我的目标是拥有一个 xsd 文件而不是两个,并且仍然具有相同的功能(这样我就只能有一个 wsdl),我试图在这里和 goolge 中搜索类似的问题,但找不到任何问题,也许我写错了问题:/
文件 1 和 2:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.org.com/action"
targetNamespace="http://www.org.com/action" elementFormDefault="qualified">
<xs:element name="getActionRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getActionResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.org.com/validate"
targetNamespace="http://www.org.com/validate" elementFormDefault="qualified">
<xs:element name="getValidateRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
<xs:element name="Value" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getValidateResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
应该可行:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.org.com/action"
targetNamespace="http://www.org.com/action"
elementFormDefault="qualified">
<xs:element name="getActionRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getActionResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getValidateRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
<xs:element name="Value" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getValidateResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>