【发布时间】:2017-02-20 22:51:33
【问题描述】:
我需要使用 PHP 中的 SoapClient 实例来使用 SOAP 服务。
它会抛出这个验证错误:
+"ValidationError": "cvc-type.2: 类型定义不能 元素 ns1:risk 的摘要。”
我应该如何将type属性添加到数组中,像这样(第一行,类型定义):
<xs1:risk xsi:type="xs:Car">
<xs:base7>
<xs:base7code>00054030014</xs:base7code>
</xs:base7>
<xs:plate>8726CJR</xs:plate>
<xs:matriculationDate>2003-06-15</xs:matriculationDate>
<xs:purchaseDate>2003-06-15</xs:purchaseDate>
<xs:postalCode>03550</xs:postalCode>
<xs:town>SANT JOAN D'ALACANT</xs:town>
<xs:trailer>false</xs:trailer>
<xs:garageType>10</xs:garageType>
<xs:yearKilometers>28</xs:yearKilometers>
<xs:habitualDriver>
<xs1:identificationType>2</xs1:identificationType>
<xs1:identification>85858585E</xs1:identification>
<xs1:birthDate>1978-11-09</xs1:birthDate>
<xs1:gender>1</xs1:gender>
<xs1:personPermissionDate>1997-03-02</xs1:personPermissionDate>
<xs1:personExpeditionZone>1</xs1:personExpeditionZone>
<xs1:personMaritalStatus>3</xs1:personMaritalStatus>
</xs:habitualDriver>
<xs:owner>
<xs1:identificationType>2</xs1:identificationType>
<xs1:identification>85858585E</xs1:identification>
</xs:owner>
</xs1:risk>
【问题讨论】:
-
你能澄清你的问题吗?
-
“像这样”像什么?
-
对不起。我会澄清...我需要构造一个带有属性的数组(这很重要,如代码的第一行所示)。如果不可能,另一种方法是构造 xml,然后转换为数组……服务器端是 WSDL。欢迎任何帮助,谢谢!