我正在创建一个标准对象,该对象通过带有 _soapcall 的 SOAP 发送到 wsdl wevservice。
当我只发送一个参数时它可以工作,但有时我需要在同一个标签下发送 2 个参数,我不知道如何制作它。让我稍微解释一下。
我创建了 2 个标准对象:
对象 1
$sObject4->PropertyToSearchName = 'State';
$sObject4->SearchComparer = 'Equals';
$sObject4->Value = new SoapVar(2, XSD_INT, 'int','http://www.w3.org/2001/XMLSchema');
$sObject3->SearchObject = $sObject4;
对象 2
$sObject41->PropertyToSearchName = 'ProviderId';
$sObject41->SearchComparer = 'Equals';
$sObject41->Value = new SoapVar(21, XSD_INT, 'int','http://www.w3.org/2001/XMLSchema');
$sObject31->SearchObject = $sObject41;
所以我需要合并这两个对象,所以我最终得到了类似的东西:
[ListOfSearchObjects] => stdClass Object
(
[SearchObject] => stdClass Object
(
[PropertyToSearchName] => State
[SearchComparer] => Equals
[Value] => SoapVar Object
(
[enc_type] => 135
[enc_value] => 2
[enc_stype] => int
[enc_ns] => http://www.w3.org/2001/XMLSchema
)
)
[SearchObject] => stdClass Object
(
[PropertyToSearchName] => ProviderId
[SearchComparer] => Equals
[Value] => SoapVar Object
(
[enc_type] => 135
[enc_value] => 21
[enc_stype] => int
[enc_ns] => http://www.w3.org/2001/XMLSchema
)
)
)
使用 2 [SearchObject] 创建的肥皂需要如下所示:
<ns3:ListOfSearchObjects>
<ns3:SearchObject>
<ns3:PropertyToSearchName>State</ns3:PropertyToSearchName>
<ns3:SearchComparer>Equals</ns3:SearchComparer>
<ns3:Value xsi:type="xsd:int">2</ns3:Value>
</ns3:SearchObject>
<ns3:SearchObject>
<ns3:PropertyToSearchName>Providerid</ns3:PropertyToSearchName>
<ns3:SearchComparer>Equals</ns3:SearchComparer>
<ns3:Value xsi:type="xsd:int">21</ns3:Value>
</ns3:SearchObject>
</ns3:ListOfSearchObjects>