我正在創建一個stdobject,通過帶有_soapcall的SOAP發送到wsdl wevservice。php stdClass對象重複
它發揮作用時,我只發送一個參數,但有時我需要發送2個參數在相同的標籤下,我不知道它很熱。讓我稍微解釋一下。
我創建2個STD對象:
對象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;
所以我需要合併這2個對象,所以我最終是這樣的:
[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>
你有WSDL嗎? –