0
這是我第一次在php應用程序中使用帶有SOAP的Web服務。 其實我做這樣的事情:Php肥皂客戶端多節點
$urlxml = "https://rec.wspar51.april.fr/WSSante/WSSante.asmx?wsdl";
$client = new SoapClient($urlxml);
$parameters = new stdClass();
$parameters->astr_Clef = "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}";
$parameters->TarifParams = new stdClass();
$parameters->TarifParams->IdCo = "00000";
$parameters->TarifParams->Devis = new stdClass();
$parameters->TarifParams->Devis->Assure = new stdClass();
$parameters->TarifParams->Devis->Assure->Nom = "toto";
$parameters->TarifParams->Devis->Assure->Prenom = "titi";
$parameters->TarifParams->Devis->Assure->NumeroAssure = 1;
$parameters->TarifParams->Devis->Assure->Type = "Adherent";
$parameters->TarifParams->Devis->Assure->DateNaissance = "19800615";
$parameters->TarifParams->Devis->Assure->RegimeObligatoire = "SS";
$parameters->TarifParams->Devis->Parametres = new stdClass();
$parameters->TarifParams->Devis->Parametres->DateEffet ="20110809";
$parameters->TarifParams->Devis->Parametres->CodePostal ="27140";
$parameters->TarifParams->Devis->Parametres->BesoinHospitalisation ="Minimum";
$parameters->TarifParams->Devis->Parametres->BesoinFraisMedicaux ="Complete";
$parameters->TarifParams->Devis->Parametres->BesoinDentaire ="Complete";
$parameters->TarifParams->Devis->Parametres->BesoinOptique ="Maximum";
$parameters->TarifParams->Devis->Parametres->Produit ="";
$parameters->TarifParams->Devis->Parametres->DeuxEurosMalins = False;
try{
echo "<pre>";
print_r($parameters);
echo "</pre>";
$response = $client->Tarif($parameters);
echo "<pre>";
print_r($response);
echo "</pre>";
}
catch(Exception $e){
echo '<br /><hr />';
echo "<b>Exception est :</b> " . $e;
}
我的問題是:如何才能讓許多Devis->保證不對在這個documentation或者是下面的例子?
<Assure>
<Nom>#nom1#</Nom>
<Prenom>#prenom1#</Prenom>
<NumeroAssure>#panier#</NumeroAssure>
<Type>Adherent</Type>
<DateNaissance>#dn1webservice#</DateNaissance>
<RegimeObligatoire>#reg1#</RegimeObligatoire>
</Assure>
<cfif len(trim(civ2)) gt 0>
<Assure>
<Nom>#nom2#</Nom>
<Prenom>#prenom2#</Prenom>
<NumeroAssure>#panier#</NumeroAssure>
<Type>Conjoint</Type>
<DateNaissance>#dn2webservice#</DateNaissance>
<RegimeObligatoire>#reg1#</RegimeObligatoire>
</Assure>
</cfif>'
我需要做一個數組或類似的東西?