Passing parameters in the client
| From: | Kevin Barnard | Date: | Thu, 07 Sep 2006 04:47:04 +0000 |
| Subject: | Passing parameters in the client | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-2368@lists.php.net to get a copy of this message | ||
I've racked my brain and can't seem to get this right.
Here's what I'm trying to do. I want to create a web service where I
can setup a client like eBay or Amazon. Something to the effect of
$client = new SoapClient('some.wsdl');
$client->getQuote(array('symbol' => 'ibm'));
When I try this my request sends
<item><key>symbol</key><value>ibm</value></item>
What I am trying to get is
<symbol>ibm</symbol>
If I use
class test {public $symbol; function __construct($x) {$this->symbol=$x;}}
$x = new test('ibm');
$client->getQuote($x);
I get the proper result. I have a feeling there is something in the
WSDL that can fix this but I'm not sure. I know it's possible to get
the parameter array to work because that's how I'm using eBay.
What am I doing wrong?
--
Kevin Barnard
"Great Beauty, great strength, and great Riches,
are really and truly of no great Use;
a right Heart exceeds all." -- Benjamin Franklin