SOAP / Problème avec multinamespace
Bonjour,
Je suis bloqué sur un WSDL qui a 2 namespaces différents.
En raccourci, il est de cette forme là :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns1:openTest xmlns:ns1="URL_NAMESPACE1" xmlns:ns2="URL_NAMESPACE2">
<ns1:authentication>
<ns1:user>USER</ns1:user>
....
</ns1:authentication>
<ns1:object>
<ns2:Infos xml:lang="fr">
<ns2:nom>TOTO</ns2:nom>
<ns2:famille>
<ns2:pere>PAPA</ns2:pere>
<ns2:mere>
<ns2:value>maman</ns2:value>
</ns2:mere>
....
<ns2:noeud>
<ns1:BLOQUANT>YOUPI</ns1:BLOQUANT>
</ns2:noeud>
</ns2:famille>
....
</ns2:Infos>
</ns1:object>
</ns1:openTest>
</S:Body>
</S:Envelope> |
J'utilise ce bout de code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
$client = new \SoapClient($url, [
'exceptions' => true,
'trace' => true,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'cache_wsdl' => WSDL_CACHE_NONE,
'encoding' => 'UTF-8'
]);
$params = [
'authentication' => [
'user' => 'USER'
],
'object' => [
'Infos' => [
'lang' => 'fr',
'nom' => 'TOTO',
'famille' => [
'pere' => 'PAPA',
'mere' => [
'value' => 'maman'
]
],
...
'noeud' => [
'BLOQUANT' => 'YOUPI'
]
],
...
];
$sReturn = $client->MAMETHODE($params); |
Quand je fais un $client->__getLastRequest(), tout est rempli, sauf le noeud qui donne '<ns2:noeud/>'.
J'ai essayé avec SoapVar, dans le genre
Code:
1 2 3 4
|
'noeud' => [
'BLOQUANT' => new \SoapVar('YOUPI', XSD_STRING, null, null, 'BLOQUANT', 'URL_NAMESPACE1')
] |
Ou
Code:
1 2 3 4
|
'noeud' => [
new \SoapVar('YOUPI', XSD_STRING, null, null, 'BLOQUANT', 'URL_NAMESPACE1')
] |
Ou
Code:
1 2
|
'noeud' => new \SoapVar([new \SoapVar('YOUPI', XSD_STRING, null, null, 'BLOQUANT', 'URL_NAMESPACE1')], SOAP_ENC_OBJECT) |
Bref, rien qui fonctionne...
Avez vous des idées ?
Merci beaucoup