我使用php从webservice获取数据。 我有这段代码:
try
{
$wsdl_url = 'https://xxx';
$client = new SOAPClient($wsdl_url);
$params = array(
'Code' => '1111',
'Name' => 'Marcos',
'Client' => '009462'
);
$return = $client->GetData($params);
print_r($return);
}
catch (Exception $e)
{
echo "Exception occured: " . $e;
}
现在,我有一个带参数的xml。 例如:
<san:GetData>
<san:objData xsi:type="PricesData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://">
<san:Code>7</san:Code>
<san:Client>999999</san:Client>
<san:Data>
<san:Fact>CF</san:Fact>
<san:Fact2>CF</san:Fact2>
</san:Data>
<san:DataProduct>
<san:Code>0202</san:Code>
<san:PersonalData>
<san:Name>00030</san:Name>
<san:Company>00045</san:Company>
</san:PersonalData>
</san:DataProduct>
</san:objData>
如何为php数组传递这些参数?因为它有数据到“类别”,我不知道如何操纵它们。
感谢。