在我SoapClient的情況下,請求XML應該是這樣的:如何構建KeyValuePair在PHP的SoapClient的
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope">
<SOAP-ENV:Body>
<SoapFunction xmlns="http://services.***/">
<prop1>value1</prop1>
<prop2>value2</prop2>
<prop3>
<KeyValuePair>
<Key>string</Key>
<Value>string</Value>
</KeyValuePair>
<KeyValuePair>
<Key>string</Key>
<Value>string</Value>
</KeyValuePair>
</prop3>
</SoapFunction>
</SOAP-ENV:Body>
</sSOAP-ENV:Envelope>
我可以通過下面的代碼建立正確PROP1和PROP2:
$parameters = array(
'prop1' => value1,
'prop2' => value2
);
$request = array($parameters);
$client->__soapCall('SoapFunction', $request);
但我怎麼能建立財產prop3,尤其是構造型KeyValuePair這是在WSDL文件中定義
當然,這個解決方案應該可以工作,但我必須找到插入KeyValuePair節點的正確位置,這不是動態和靈活的 – Hyden 2012-08-07 01:08:31