You have to use SoapVar instead of SoapParam if you want it to do something fancy like using different opening and closing tags. I ran into this using the SOAP API for Zimbra.
SoapParam::SoapParam
(PHP 5 >= 5.0.1)
SoapParam::SoapParam — Constructeur SoapParam
Description
Construit un nouvel objet SoapParam.
Liste de paramètres
- data
-
Les données à passer ou à retourner. Vous pouvez passer ce paramètre directement en tant qu'une valeur PHP, mais dans ce cas, il sera nommé paramN et le service SOAP ne le comprendra pas.
- name
-
Le nom du paramètre.
Exemples
Exemple #1 Quelques exemples
<?php
$client = new SoapClient(null,array('location' => "http://localhost/soap.php",
'uri' => "http://test-uri/"));
$client->SomeFunction(new SoapParam($a, "a"),
new SoapParam($b, "b"),
new SoapParam($c, "c"));
?>
Voir aussi
- SoapClient::__soapCall - Appelle une fonction SOAP
- SoapVar::SoapVar - Constructeur SoapVar
SoapParam::SoapParam
barryking93 at gmail dot com
05-Dec-2007 10:42
05-Dec-2007 10:42
Jeremy
12-Jul-2007 03:31
12-Jul-2007 03:31
Is there anyway to create a SOAP parameter like:
<a n="something">DATA</a>
If I try to form a param using the following code the resulting request is:
Code: SoapParam("DATA", "a n=\"something\"");
Result: <a n="something">DATA</a n="something">
This is giving me an error from the SOAP server because its expecting a properly formed closing tag without the encapsulated attribute.
