note 101225 modified in soapvar.soapvar by danbrown
| From: | danbrown@php.net | Date: | Fri, 03 Dec 2010 16:14:25 +0000 |
| Subject: | note 101225 modified in soapvar.soapvar by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-174590@lists.php.net to get a copy of this message | ||
It might be obvious to some but not to everyone
if you ever wondered how to encode attribute in soap object, use proper coding and not hacking by
passing xml and flag XSD_ANYXML
try using this
<?php
$amount['_'] = 25;
$amount['currencyId'] = 'GBP';
$encodded = new SoapVar($amount, SOAP_ENC_OBJECT);
?>
and end result wound be
<amount currencyId="GBP">25</amount>
hope that helps someone
--was--
It might be obvious to some but not to everyone
if you ever wondered how to encode attribute in soap object, use proper coding and not hacking by
passing xml and flag XSD_ANYXML
try using this
<?
$amount['_'] = 25;
$amount['currencyId'] = 'GBP';
$encodded = new SoapVar($amount, SOAP_ENC_OBJECT);
?>
and end result wound be
<amount currencyId="GBP">25</amount>
hope that helps someone
http://php.net/manual/en/soapvar.soapvar.php