xml代码:
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:ns2="urn:uRServerResponse" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="SBE" xmlns="http://schemas.xmlsoap.org/wsdl/" >
<types>
<xs:schema xmlns="SBE" targetNamespace="SBE">
<xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
<xs:complexType name="SBEOrder">
<xs:sequence>
<xs:element name="OrderGUID" type="xs:string" />
<xs:element name="BuyerGUID" type="xs:string" />
<xs:element name="PONumber" type="xs:string" />
<xs:element name="Status" type="xs:string" />
<xs:element name="Date_Submitted" type="xs:dateTime" />
<xs:element name="Date_Shipped" type="xs:dateTime" />
<xs:element name="Date_Received" type="xs:dateTime" />
<xs:element name="ItemCount" type="xs:int" />
<xs:element name="ActionCount" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns="urn:uRServerResponse" targetNamespace="urn:uRServerResponse">
<xs:import namespace="SBE"/>
<xs:complexType name="TSBEServerResponseBase">
<xs:sequence>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TSBEServerResponse">
<xs:complexContent mixed="false">
<xs:extension base="ns2:TSBEServerResponseBase">
<xs:sequence>
<xs:element name="SBEOrder" type="ns1:SBEOrder"/>
<xs:element name="ItemClassCount" type="xs:int" />
<xs:element name="ItemClassHistoryCount" type="xs:int" />
<xs:element name="ItemClassInfoCount" type="xs:int" />
<xs:element name="InvoiceCount" type="xs:int" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</types>
</definitions>
当我上面的部分验证时,我没有声明类型'SBE:SBEOrder'
我在上述声明中遗漏了什么?
答案 0 :(得分:0)
我实际上认为您的问题在于SOAPENC模式的导入声明:
<xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
使第一个架构无效,导致第二个架构无法引用其类型。
跳过导入声明,你应该没问题。 :)
编辑:(添加代码)
<?xml version = "1.0" encoding = "UTF-8"?>
<definitions xmlns = "http://schemas.xmlsoap.org/wsdl/" xmlns:mime = "http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns1 = "SBE" xmlns:ns2 = "urn:uRServerResponse" xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc = "http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs = "http://www.w3.org/2001/XMLSchema">
<types>
<xs:schema targetNamespace = "SBE" xmlns = "SBE">
<xs:complexType name = "SBEOrder">
<xs:sequence>
<xs:element name = "OrderGUID" type = "xs:string"/>
<xs:element name = "BuyerGUID" type = "xs:string"/>
<xs:element name = "PONumber" type = "xs:string"/>
<xs:element name = "Status" type = "xs:string"/>
<xs:element name = "Date_Submitted" type = "xs:dateTime"/>
<xs:element name = "Date_Shipped" type = "xs:dateTime"/>
<xs:element name = "Date_Received" type = "xs:dateTime"/>
<xs:element name = "ItemCount" type = "xs:int"/>
<xs:element name = "ActionCount" type = "xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema targetNamespace = "urn:uRServerResponse" xmlns = "urn:uRServerResponse">
<xs:complexType name = "TSBEServerResponseBase">
<xs:sequence> </xs:sequence>
</xs:complexType>
<xs:complexType name = "TSBEServerResponse">
<xs:complexContent mixed = "false">
<xs:extension base = "ns2:TSBEServerResponseBase">
<xs:sequence>
<xs:element name = "SBEOrder" type = "ns1:SBEOrder"/>
<xs:element name = "ItemClassCount" type = "xs:int"/>
<xs:element name = "ItemClassHistoryCount" type = "xs:int"/>
<xs:element name = "ItemClassInfoCount" type = "xs:int"/>
<xs:element name = "InvoiceCount" type = "xs:int"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</types>
</definitions>