Soap 在XSD中的ComplexType/序列元素中引用ComplexType元素
我试图构造一个xsd文件(在WSDL中)来从SOAP请求中获取数据。我有一个预期的soap请求:Soap 在XSD中的ComplexType/序列元素中引用ComplexType元素,soap,xsd,wsdl,complextype,Soap,Xsd,Wsdl,Complextype,我试图构造一个xsd文件(在WSDL中)来从SOAP请求中获取数据。我有一个预期的soap请求: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<m:upsertEntity xmlns:m="http://www.boomi.com/connector/wss">
<eTimeRequest>
<ObjectType>String</ObjectType>
<Action>String</Action>
<eTimeID>String</eTimeID>
<OperativeID>String</OperativeID>
</eTimeRequest>
</m:upsertEntity>
</SOAP-ENV:Body>
一串
一串
一串
一串
这是我试过的。您不能将
放在另一个内。我尝试过引用方法,但显然,当我尝试使用它执行SOAP请求时,它是无效的。我能做什么
以下是WSDL中的XSD:
编辑
我在链接的代码中注意到的另一件事是,我使用了Type=“eTimeRequest”
,而不是ref=“eTimeRequest”
。尽管如此,仍然无效。以下是我在验证时收到的错误消息:
无效的XML架构:“EtimereRequest”必须引用现有元素。“对于阅读此内容的人,非常抱歉。很明显,我在XSD代码中犯了一个错误,浪费了时间 的确,
在
中不允许,但是
中允许
包含
。因此,生成的原始SOAP请求无效。我通过我们的系统运行了这个新版本,它运行正常
WSDL中正确的XSD架构应为:
<xs:schema elementFormDefault="qualified" targetNamespace="http://www.boomi.com/connector/wss">
<xs:element name="upsertEntity" type="tns:upsertEntity"/>
<xs:complexType name="upsertEntity">
<xs:sequence>
<xs:element name="eTimeRequest">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="ObjectType" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="Action" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="eTimeID" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="OperativeID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema elementFormDefault="qualified" targetNamespace="http://www.boomi.com/connector/wss">
<xs:element name="upsertEntity" type="tns:upsertEntity"/>
<xs:complexType name="upsertEntity">
<xs:sequence>
<xs:element name="eTimeRequest">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="ObjectType" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="Action" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="eTimeID" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="OperativeID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>